SF 748201: time.strptime() should display format and date on error
Usability fix. Makes the error message more helpful.
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index ba9dde0..635613e 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -430,7 +430,8 @@
_regex_cache[format] = format_regex
found = format_regex.match(data_string)
if not found:
- raise ValueError("time data did not match format")
+ raise ValueError("time data did not match format: data=%s fmt=%s" %
+ (data_string, format))
if len(data_string) != found.end():
raise ValueError("unconverted data remains: %s" %
data_string[found.end():])