Issue 983585: test_repr() fails with id() values that appear negative (original) (raw)

Created on 2004-07-01 18:15 by fdrake, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
patch.txt tim.peters,2004-07-01 20:02 Don't assume hex(i) starts with '0x'
Messages (4)
msg21375 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-07-01 18:15
test_repr() fails when memory allocations are handed out at high addresses. test_repr test test_repr failed -- Traceback (most recent call last): File "/home/fdrake/projects/python/trunk/Lib/test/test_repr.py", line 109, in test_instance eq(r(i3), ("<ClassWithFailingRepr instance at %x>"%id(i3))) AssertionError: '' != '<ClassWithFailingRepr instance at -42373cf4>'
msg21376 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-07-01 18:16
Logged In: YES user_id=3066 I'll add that this was run on a Fedora Core 1 system.
msg21377 - (view) Author: Tim Peters (tim.peters) * (Python committer) Date: 2004-07-01 20:02
Logged In: YES user_id=31435 Fred, please try the attached patch. If it works on your box, just check it in. repr.py was doing a dumb thing, assuming that hex(number) always starts with '0x'. The patch also does a dumb thing, but it's the same as the dumb thing test_repr.py does .
msg21378 - (view) Author: Fred Drake (fdrake) (Python committer) Date: 2004-07-01 20:29
Logged In: YES user_id=3066 This does the trick, thanks! Committed as Lib/repr.py revision 1.20.
History
Date User Action Args
2022-04-11 14:56:05 admin set github: 40491
2004-07-01 18:15:44 fdrake create