[ python-Bugs-1741130 ] struct.pack("I", "foo"); struct.pack("L", "foo") should fail

SourceForge.net noreply at sourceforge.net
Thu Jun 21 20:36:53 CEST 2007


Bugs item #1741130, was opened at 2007-06-21 20:36
Message generated for change (Tracker Item Submitted) made by Item Submitter
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1741130&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: None
Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Private: No
Submitted By: Thomas Heller (theller)
Assigned to: Nobody/Anonymous (nobody)
Summary: struct.pack("I", "foo"); struct.pack("L", "foo") should fail

Initial Comment:
The following code prints out "I L" when run with python 2.5 and current SVN trunk (if you silence the DeprecationWarnings):

"""
import struct

for c in "bBhHiIlLqQdf":
    try:
        struct.pack(c, "foo bar")
    except struct.error:
        pass
    else:
        print c
"""

It works correctly (prints nothing) in Python 2.4.


----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1741130&group_id=5470


More information about the Python-bugs-list mailing list