[Zope3-checkins] CVS: Zope3/src/zope/app - datetimeutils.py:1.9

Garrett Smith garrett at mojave-corp.com
Tue Sep 23 20:16:57 EDT 2003


Update of /cvs-repository/Zope3/src/zope/app
In directory cvs.zope.org:/tmp/cvs-serv2752/src/zope/app

Modified Files:
	datetimeutils.py 
Log Message:
Fixed a minor bug in date parsing - IndexError was raised for short (bad) input.

=== Zope3/src/zope/app/datetimeutils.py 1.8 => 1.9 ===
--- Zope3/src/zope/app/datetimeutils.py:1.8	Thu Apr 24 13:43:22 2003
+++ Zope3/src/zope/app/datetimeutils.py	Tue Sep 23 20:16:26 2003
@@ -529,7 +529,7 @@
         if not arg:
             raise SyntaxError(arg)
 
-        if arg.find(' ')==-1 and arg[4]=='-':
+        if arg.find(' ')==-1 and len(arg) >= 5 and arg[4]=='-':
             yr,mo,dy,hr,mn,sc,tz=self._parse_iso8601(arg)
         else:
             yr,mo,dy,hr,mn,sc,tz=self._parse(arg, local)




More information about the Zope3-Checkins mailing list