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.

classification
Title: test_repr() fails with id() values that appear negative
Type: Stage:
Components: Library (Lib) Versions: Python 2.4
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: fdrake Nosy List: fdrake, tim.peters
Priority: normal Keywords:

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
x42373cf4>' != '<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 <wink>.
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:05adminsetgithub: 40491
2004-07-01 18:15:44fdrakecreate