This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author hagen
Recipients hagen
Date 2009-02-10.07:14:26
SpamBayes Score 7.965644e-06
Marked as misclassified No
Message-id <1234250088.94.0.680929615779.issue5198@psf.upfronthosting.co.za>
In-reply-to
Content
struct.pack seems to raise a DeprecationWarning for some structure
formats, but not for others:

Python 2.6.1 (r261:67515, Dec  5 2008, 07:40:41) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import struct
>>> struct.pack(">H", 1.0)
sys:1: DeprecationWarning: integer argument expected, got float
'\x00\x01'
>>> struct.pack("H", 1.0)
'\x01\x00'


In addition the DeprecationWarning message gives a strange location for
the problem. With the attached struct_warning.py it locates the problem
at the function call foo() instead of the problematic call of struct.pack:

$ python2.6 struct_warning.py 
struct_warning.py:6: DeprecationWarning: integer argument expected, got
float
  foo()
History
Date User Action Args
2009-02-10 07:14:49hagensetrecipients: + hagen
2009-02-10 07:14:48hagensetmessageid: <1234250088.94.0.680929615779.issue5198@psf.upfronthosting.co.za>
2009-02-10 07:14:28hagenlinkissue5198 messages
2009-02-10 07:14:27hagencreate