This bug has been fixed in trunk and will be part of the forthcoming release candidate (http://bugs.jython.org/issue1662). It in fact was due to an unterminated quote, as the error below reports, because the quoting in Jython's strptime didn't properly terminate quoted characters if the literal was the last character in the parse format, as we see with ISO 8601 formatted timestamps with a 'Z' timezone to indicate UTC time.

On Sat, Oct 2, 2010 at 7:37 AM, Benjamin Scherrey <scherrey@proteus-tech.com> wrote:
Trying to execute the following code works under c-python but fails
under jython:

import datetime
datetime.datetime.strptime("2010-07-05T09:20:24Z","%Y-%m-%dT%H:%M:%SZ")

results under Jython 2.5.2b1 (Release_2_5_2beta1:7075, Jun 28 2010, 07:44:20):
Traceback (most recent call last):
 File "<stdin>", line 1, in <module>
 File "/opt/jython2.5.2b1/Lib/datetime.py", line 1499, in strptime
   return cls(*(_time.strptime(date_string, format))[0:6])
       at java.text.SimpleDateFormat.compile(SimpleDateFormat.java:783)
       at java.text.SimpleDateFormat.initialize(SimpleDateFormat.java:576)
       at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:501)
       at java.text.SimpleDateFormat.<init>(SimpleDateFormat.java:476)
       at org.python.modules.time.Time.strptime(Time.java:707)
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(NativeMethodAccessorImpl.java:57)
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(DelegatingMethodAccessorImpl.java:43)
       at java.lang.reflect.Method.invoke(Method.java:616)

java.lang.IllegalArgumentException:
java.lang.IllegalArgumentException: Unterminated quote


results under Python 2.6.4 (r264:75706, Jun 16 2010, 19:34:45):
datetime.datetime(2010, 7, 5, 9, 20, 24)

Did I get something wrong?

 -- Ben

------------------------------------------------------------------------------
Start uncovering the many advantages of virtual appliances
and start using them to simplify application deployment and
accelerate your shift to cloud computing.
http://p.sf.net/sfu/novell-sfdev2dev
_______________________________________________
Jython-users mailing list
Jython-users@lists.sourceforge.net
https://lists.sourceforge.net/lists/listinfo/jython-users