[New-bugs-announce] [issue4228] struct.pack('L', -1)

Armin Rigo report at bugs.python.org
Wed Oct 29 16:41:02 CET 2008


New submission from Armin Rigo <arigo at users.sourceforge.net>:

struct.pack('L', -1) raises a DeprecationWarning since Python 2.5, as it
should.  However, it also returns a different (and nonsensical) result
than Python <= 2.4 used to: it returns '\x00\x00\x00\x00' instead of
'\xff\xff\xff\xff'.

This might lead the zipfile module of release25-maint (the version >=
2.5.2) to produce buggy zip files.  The -1 value can come as the
header_offset field, which will then be packed as an all-0 string
instead of an all-ff string in the zip file headers.

Given the DeprecationWarning I would classify this as low priority. 
However, given that the stdlib module zipfile relies on this feature in
release25-maint, it should probably really be fixed.

----------
messages: 75319
nosy: arigo
severity: normal
status: open
title: struct.pack('L', -1)
versions: Python 2.5, Python 2.5.3, Python 2.6, Python 2.7

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue4228>
_______________________________________


More information about the New-bugs-announce mailing list