[Python-checkins] python/dist/src/Lib _strptime.py,1.20,1.21

rhettinger@users.sourceforge.net rhettinger@users.sourceforge.net
Sat, 12 Jul 2003 18:31:40 -0700


Update of /cvsroot/python/python/dist/src/Lib
In directory sc8-pr-cvs1:/tmp/cvs-serv14273

Modified Files:
	_strptime.py 
Log Message:
SF 748201:  time.strptime() should display format and date on error

Usability fix.  Makes the error message more helpful.



Index: _strptime.py
===================================================================
RCS file: /cvsroot/python/python/dist/src/Lib/_strptime.py,v
retrieving revision 1.20
retrieving revision 1.21
diff -C2 -d -r1.20 -r1.21
*** _strptime.py	3 Jul 2003 19:59:57 -0000	1.20
--- _strptime.py	13 Jul 2003 01:31:38 -0000	1.21
***************
*** 431,435 ****
      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" %
--- 431,436 ----
      found = format_regex.match(data_string)
      if not found:
!         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" %