summaryrefslogtreecommitdiff
path: root/Lib/_strptime.py
diff options
context:
space:
mode:
Diffstat (limited to 'Lib/_strptime.py')
-rw-r--r--Lib/_strptime.py3
1 files changed, 3 insertions, 0 deletions
diff --git a/Lib/_strptime.py b/Lib/_strptime.py
index 81c105f758..4b7a7dd615 100644
--- a/Lib/_strptime.py
+++ b/Lib/_strptime.py
@@ -423,6 +423,9 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
found = format_regex.match(data_string)
if not found:
raise ValueError("time data did not match format")
+ if len(data_string) != found.end():
+ raise ValueError("unconverted data remains: %s" %
+ data_string[found.end():])
year = 1900
month = day = 1
hour = minute = second = 0