Skip to content

TypeError: unpack_from() argument 1 must be string or read-only buffer, ...#14

Open
bigner wants to merge 1 commit intobvanheu:masterfrom
bigner:master
Open

TypeError: unpack_from() argument 1 must be string or read-only buffer, ...#14
bigner wants to merge 1 commit intobvanheu:masterfrom
bigner:master

Conversation

@bigner
Copy link

@bigner bigner commented Mar 9, 2015

...not bytearray

Fixes an error with manager.py causing the following error.

~/stratasys $ ./stratasys-cartridge.py info --machine-type prodigy
--eeprom-uid d1000000a8ae2523 -i new_eeprom.bin
Traceback (most recent call last):
File "./stratasys-cartridge.py", line 204, in
app.run()
File "./stratasys-cartridge.py", line 47, in run
args.func(args)
File "./stratasys-cartridge.py", line 134, in command_info
cartridge = m.decode(machine_number, args.eeprom_uid,
cartridge_crypted)
File "/home/pi/stratasys/stratasys/manager.py", line 74, in decode
cartridge = self.unpack(cartridge_packed)
File "/home/pi/stratasys/stratasys/manager.py", line 137, in unpack
serial_number = struct.unpack_from("<d", cartridge_packed, 0x0)[0]
TypeError: unpack_from() argument 1 must be string or read-only buffer,
not bytearray

…r, not bytearray

Fixes an error with manager.py causing the following error.

 ~/stratasys $ ./stratasys-cartridge.py info --machine-type prodigy
--eeprom-uid d1000000a8ae2523 -i new_eeprom.bin
Traceback (most recent call last):
  File "./stratasys-cartridge.py", line 204, in <module>
    app.run()
  File "./stratasys-cartridge.py", line 47, in run
    args.func(args)
  File "./stratasys-cartridge.py", line 134, in command_info
    cartridge = m.decode(machine_number, args.eeprom_uid,
cartridge_crypted)
  File "/home/pi/stratasys/stratasys/manager.py", line 74, in decode
    cartridge = self.unpack(cartridge_packed)
  File "/home/pi/stratasys/stratasys/manager.py", line 137, in unpack
    serial_number = struct.unpack_from("<d", cartridge_packed, 0x0)[0]
TypeError: unpack_from() argument 1 must be string or read-only buffer,
not bytearray
@bvanheu
Copy link
Owner

bvanheu commented Mar 13, 2015

Hi, thanks for your patch.

Which version of python are you using? <= 2.7.3 I guess?

@bigner
Copy link
Author

bigner commented Mar 16, 2015

Correct. Running 2.7.3 on Raspberry PI. Took a while to figure it out.

@toma678
Copy link

toma678 commented Aug 8, 2015

Can confirm patch works.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants