Hi all,
I have discovered that in my Python 2.4.1 installation (on Solaris 8),
struct.pack handles things in a way that seems inconsistent to me.
I haven't found any comprehensible documentation over known issues with
Python 2.4.1 so I try this...
Here's the thing:
Traceback (most recent call last):
File "<stdin>", line 1, in ?
struct.error: ubyte format requires 0<=number<=255
Traceback (most recent call last):
File "<stdin>", line 1, in ?
struct.error: short format requires 0<=number<=USHR T_MAX
'\xff\xff\xff\x ff'
Shouldn't pack('L', -1) raise an exception like the others, rather than
behaving like pack('l', -1)?
Is this fixed in later versions?
(I don't have access to later versions and have failed to install any.
Python 2.5 compiles nicely but "make install" fails without leaving any
clues about how it failed and no installation troubleshooting guides to
be found at python.org. Python 2.4.4 doesn't even compile since it
apparently requires a newer libstdc++ than the one on our system... see
why I'm asking the newsgroup?)
--
--
Christer Jansson
WiseOne AB
+46 708 21 42 84
I have discovered that in my Python 2.4.1 installation (on Solaris 8),
struct.pack handles things in a way that seems inconsistent to me.
I haven't found any comprehensible documentation over known issues with
Python 2.4.1 so I try this...
Here's the thing:
>>from struct import pack
>>pack('B', -1)
>>pack('B', -1)
File "<stdin>", line 1, in ?
struct.error: ubyte format requires 0<=number<=255
>>pack('H', -1)
File "<stdin>", line 1, in ?
struct.error: short format requires 0<=number<=USHR T_MAX
>>pack('L', -1)
>>>
behaving like pack('l', -1)?
Is this fixed in later versions?
(I don't have access to later versions and have failed to install any.
Python 2.5 compiles nicely but "make install" fails without leaving any
clues about how it failed and no installation troubleshooting guides to
be found at python.org. Python 2.4.4 doesn't even compile since it
apparently requires a newer libstdc++ than the one on our system... see
why I'm asking the newsgroup?)
--
--
Christer Jansson
WiseOne AB
+46 708 21 42 84
Comment