[Python-Dev] test warnings for "%x"%id(foo) on 2.3 branch

Alex Martelli aleaxit at yahoo.com
Tue Nov 4 15:50:32 EST 2003


On Tuesday 04 November 2003 03:01 pm, Anthony Baxter wrote:
> I'm seeing a couple of warnings that I don't remember seeing at
> the time of the 2.3.2 release. Given what they are, it's possible
> that it's just a random thing (whether the id is < 0 or not).
>
> test_minidom
> /home/anthony/src/py/23maint/Lib/xml/dom/minidom.py:797: FutureWarning:
> %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and
> up return "<DOM Element: %s at %#x>" % (self.tagName, id(self))
>
> test_repr
> /home/anthony/src/py/23maint/Lib/test/test_repr.py:91: FutureWarning:
> %u/%o/%x/%X of negative int will return a signed string in Python 2.4 and
> up eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3)))
>
> Anyone want to suggest an appropriate fix, or fix them? Otherwise I'll
> put it on the to-do list.

Not sure if it's "appropriate", but what other tests appear to be doing is
to explicitly mark warnings (& specifically this one) as ignored:

regrtest.py:# I see no other way to suppress these warnings;
regrtest.py:warnings.filterwarnings("ignore", "hex/oct constants", 
FutureWarning,
regrtest.py:    warnings.filterwarnings("ignore", "hex/oct constants", 
FutureWarning,

test_builtin.py:warnings.filterwarnings("ignore", "hex../oct.. of negative 
int",
test_builtin.py:                        FutureWarning, __name__)

test_compile.py:        warnings.filterwarnings("ignore", "hex/oct constants", 
FutureWarning)
test_compile.py:        warnings.filterwarnings("ignore", "hex.* of negative 
int", FutureWarning)

test_hexoct.py:warnings.filterwarnings("ignore", "hex/oct constants", 
FutureWarning,


Alex




More information about the Python-Dev mailing list