Message65586
Here is a bug in Python 2.5 which would be nice to fix for Py3k (since
we are already breaking compatibility):
Take a string:
s = "Hello"
Create a KeyError exception with that string:
e = KeyError(s)
Counterintuitively, casting the exception to a string doesn't return the
same string:
str(e) != s
Instead, when KeyError is cast to a string it affixes single-quotes
around the string.
I have create a test which shows that the other built-in exceptions
(except for 3 Unicode Errors which seem to be unusual in that they don't
accept just a string), do indeed round-trip the string unaltered.
This actually caused a bug (in an old version of zope.DocumentTemplate).
I am including the test case I wrote for now; I will begin looking into
a solution shortly and hopefully whip up a patch. |
|
| Date |
User |
Action |
Args |
| 2008-04-17 17:24:42 | rharris | set | spambayes_score: 0.117869 -> 0.117869 recipients:
+ rharris |
| 2008-04-17 17:24:41 | rharris | set | spambayes_score: 0.117869 -> 0.117869 messageid: <1208453081.65.0.886847251895.issue2651@psf.upfronthosting.co.za> |
| 2008-04-17 17:24:40 | rharris | link | issue2651 messages |
| 2008-04-17 17:24:39 | rharris | create | |
|