[issue8957] strptime(.., '%c') fails to parse output of strftime('%c', ..) in some locales
Eli Bendersky
report at bugs.python.org
Sat Jan 15 08:20:54 CET 2011
Eli Bendersky <eliben at gmail.com> added the comment:
I'm attaching a patch for Lib/_strptime.py that handles the month differently in __calc_date_time. It cycles all months, trying to find one where the full and abbrev names are different and matches it against the timestamp created by strftime.
This solution is a hack, but so is the whole __calc_date_time function :-) [IMHO]
All tests pass and I also tried it manually with all the problematic locales reported by Alexander - seems to work correctly.
If this looks OK to you guys I can commit and backport.
----------
keywords: +patch
Added file: http://bugs.python.org/file20412/issue8957.py3k.1.patch
_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue8957>
_______________________________________
More information about the Python-bugs-list
mailing list