Message81532
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() |
|
Date |
User |
Action |
Args |
2009-02-10 07:14:49 | hagen | set | recipients:
+ hagen |
2009-02-10 07:14:48 | hagen | set | messageid: <1234250088.94.0.680929615779.issue5198@psf.upfronthosting.co.za> |
2009-02-10 07:14:28 | hagen | link | issue5198 messages |
2009-02-10 07:14:27 | hagen | create | |
|