classification
Title: pprint._safe_repr() unsafe on ordering differently types objects with same str represenation
Type: behavior Stage:
Components: Library (Lib) Versions: Python 3.0
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: Nosy List: jafo, simon.percivall
Priority: normal Keywords: patch

Created on 2008-02-12 02:47 by simon.percivall, last changed 2008-03-18 23:00 by simon.percivall. This issue is now closed.

Files
File name Uploaded Description Edit
pprint.diff simon.percivall, 2008-02-12 02:47 pprint with fix diff from r60741
test_pprint30_bug.py simon.percivall, 2008-03-18 22:56 test case to demonstrate pprint problem
Messages (3)
msg62303 - (view) Author: Simon Percivall (simon.percivall) Date: 2008-02-12 02:47
_safe_repr() tries to handle the case where two objects are unorderable by 
ordering on (str(type(key)), key, value), but this fails when 
str(type(key)) is equal for two objects, but key is different and 
unorderable. Easy fix: order just on the string representation.
msg63972 - (view) Author: Sean Reifschneider (jafo) * (Python committer) Date: 2008-03-18 19:28
I don't know if this is still relevent, if it is please provide a test
that demonstrates it.  I've checked the code and found that the code to
be patched no longer exists.  To me, it looks like it might be resolved.
msg64011 - (view) Author: Simon Percivall (simon.percivall) Date: 2008-03-18 23:00
It's still a problem, as the test case demonstrates.
History
Date User Action Args
2008-03-18 23:00:11simon.percivallsetmessages: + msg64011
2008-03-18 22:56:50simon.percivallsetfiles: + test_pprint30_bug.py
2008-03-18 19:28:09jafosetstatus: open -> closed
nosy: + jafo
messages: + msg63972
priority: normal
type: behavior
keywords: + patch
resolution: out of date
2008-02-12 02:47:18simon.percivallcreate