]> granicus.if.org Git - python/commitdiff
Make the error message for when the time data and format do not match clearer.
authorBrett Cannon <bcannon@gmail.com>
Tue, 26 Sep 2006 23:38:24 +0000 (23:38 +0000)
committerBrett Cannon <bcannon@gmail.com>
Tue, 26 Sep 2006 23:38:24 +0000 (23:38 +0000)
Lib/_strptime.py
Misc/NEWS

index ce8525b7169ba39e1e1f981d7ccd738fe947dd57..3fb56020e29fb1e0a8ce81a2971935df8d282f90 100644 (file)
@@ -306,7 +306,7 @@ def strptime(data_string, format="%a %b %d %H:%M:%S %Y"):
         _cache_lock.release()
     found = format_regex.match(data_string)
     if not found:
-        raise ValueError("time data did not match format:  data=%s  fmt=%s" %
+        raise ValueError("time data %r does not match format %r" %
                          (data_string, format))
     if len(data_string) != found.end():
         raise ValueError("unconverted data remains: %s" %
index c1a3a6cc3c4889c51df64e1ce85c51f2957b6c3c..b7c69c184fbeabaa40e5cacfb956d17d9a2e33d9 100644 (file)
--- a/Misc/NEWS
+++ b/Misc/NEWS
@@ -56,6 +56,9 @@ Core and builtins
 Library
 -------
 
+- Made the error message for time.strptime when the data data and format do
+  match be more clear.
+
 - Fix a bug in traceback.format_exception_only() that led to an error
   being raised when print_exc() was called without an exception set.
   In version 2.4, this printed "None", restored that behavior.