[Python-checkins] r52011 - in python/trunk: Lib/_strptime.py Misc/NEWS

brett.cannon python-checkins at python.org
Wed Sep 27 01:38:24 CEST 2006


Author: brett.cannon
Date: Wed Sep 27 01:38:24 2006
New Revision: 52011

Modified:
   python/trunk/Lib/_strptime.py
   python/trunk/Misc/NEWS
Log:
Make the error message for when the time data and format do not match clearer.


Modified: python/trunk/Lib/_strptime.py
==============================================================================
--- python/trunk/Lib/_strptime.py	(original)
+++ python/trunk/Lib/_strptime.py	Wed Sep 27 01:38:24 2006
@@ -306,7 +306,7 @@
         _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" %

Modified: python/trunk/Misc/NEWS
==============================================================================
--- python/trunk/Misc/NEWS	(original)
+++ python/trunk/Misc/NEWS	Wed Sep 27 01:38:24 2006
@@ -56,6 +56,9 @@
 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.


More information about the Python-checkins mailing list