Message120908
Okay, so line 187 of locale.py has this test:
if not match or len(match.group())!= len(percent):
the problematic part is the len test. When format string is '%.0f KB' match.group() is '%.0f' but of course percent is the full string.
This seems like a bogus test, since clearly the given input is a valid format string. I'm not sure what the intent of this test is. The Python 2.6 test is:
if percent[0] != '%':
which is perhaps too naive.
I guess I don't understand why this test is here. Wouldn't it make more sense to either just let any TypeError from _format() to percolate up, or to catch that TypeError and transform it into the ValueError? Why try to replicate the logic of str.__mod__()? |
|
Date |
User |
Action |
Args |
2010-11-09 23:58:54 | barry | set | recipients:
+ barry, amaury.forgeotdarc, r.david.murray |
2010-11-09 23:58:54 | barry | set | messageid: <1289347134.38.0.332414176414.issue10379@psf.upfronthosting.co.za> |
2010-11-09 23:58:52 | barry | link | issue10379 messages |
2010-11-09 23:58:52 | barry | create | |
|