[issue1741130] struct.pack("I", "foo"); struct.pack("L", "foo") should fail
Virgil Dupras
report at bugs.python.org
Wed Apr 1 18:27:46 CEST 2009
Virgil Dupras <hsoft at hardcoded.net> added the comment:
While the behavior cannot be reproduced in the trunk, in can be
reproduced in the 2.6 release:
$ python -W ignore
Python 2.6.1 (r261:67515, Dec 6 2008, 16:42:21)
[GCC 4.0.1 (Apple Computer, Inc. build 5370)] on darwin
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.pack('L', 'foobar')
'\x00\x00\x00\x00'
>>> struct.pack('I', 'foobar')
'\x00\x00\x00\x00'
>>> struct.pack('i', 'foobar')
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
struct.error: required argument is not an integer
>>>
----------
nosy: +vdupras
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue1741130>
_______________________________________
More information about the Python-bugs-list
mailing list