[Python-Dev] test_gzip/test_tarfile failure om AMD64

Tim Peters tim.peters at gmail.com
Tue May 30 05:00:09 CEST 2006


[Bob Ippolito]
>> ...
>> Actually, should this be a FutureWarning or a DeprecationWarning?

Since it was never documented, UndocumentedBugGoingAwayError ;-)
Short of that, yes, DeprecationWarning.  FutureWarning is for changes
in non-exceptional behavior (.e.g, if we swapped the meanings of "<"
and ">" in struct format codes, that would rate a FutureWarning
subclass, line InsaneFutureWarning).

> OK, this behavior is implemented in revision 46537:
>
> (this is from ./python.exe -Wall)
>
>  >>> import struct

...

>  >>> struct.pack('<B', -1)
> /Users/bob/src/python/Lib/struct.py:63: DeprecationWarning: struct
> integer wrapping is deprecated
>    return o.pack(*args)
> /Users/bob/src/python/Lib/struct.py:63: DeprecationWarning: 'B'
> format requires 0 <= number <= 255
>    return o.pack(*args)
> '\xff'

We certainly don't want to see two deprecation warnings for a single
deprecated behavior.  I suggest eliminating the "struct integer
wrapping" warning, mostly because I had no idea what it _meant_
before reading the comments in _struct.c  ("wrapping" is used most
often in a proxy or delegation context in Python these days).   "'B'
format requires 0 <= number <= 255" is perfectly clear all by itself.

> ...


More information about the Python-Dev mailing list