Message185495
When using a directive that is not recognised by time.strptime, the following occurs in Python 3:
>>> time.strptime("", "%D")
Traceback (most recent call last):
File "C:\Python33\lib\_strptime.py", line 320, in _strptime
format_regex = _TimeRE_cache.compile(format)
File "C:\Python33\lib\_strptime.py", line 268, in compile
return re_compile(self.pattern(format), IGNORECASE)
File "C:\Python33\lib\_strptime.py", line 262, in pattern
self[format[directive_index]])
KeyError: 'D'
During handling of the above exception, another exception occurred:
Traceback (most recent call last):
File "<stdin>", line 1, in <module>
File "C:\Python33\lib\_strptime.py", line 494, in _strptime_time
tt = _strptime(data_string, format)[0]
File "C:\Python33\lib\_strptime.py", line 329, in _strptime
(bad_directive, format))
ValueError: 'D' is a bad directive in format '%D'
>>>
Probably the KeyError should be supressed when raising the ValueError. The attached patch tries to fix this issue, by suppressing the context. |
|
Date |
User |
Action |
Args |
2013-03-29 10:48:04 | Claudiu.Popa | set | recipients:
+ Claudiu.Popa |
2013-03-29 10:48:03 | Claudiu.Popa | set | messageid: <1364554084.0.0.791831324367.issue17572@psf.upfronthosting.co.za> |
2013-03-29 10:48:03 | Claudiu.Popa | link | issue17572 messages |
2013-03-29 10:48:03 | Claudiu.Popa | create | |
|