This bug has been fixed in trunk and will be part of the forthcoming release candidate ( 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 <> wrote:
Trying to execute the following code works under c-python but fails
under jython:

import datetime

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/", line 1499, in strptime
   return cls(*(_time.strptime(date_string, format))[0:6])
       at java.text.SimpleDateFormat.compile(
       at java.text.SimpleDateFormat.initialize(
       at java.text.SimpleDateFormat.<init>(
       at java.text.SimpleDateFormat.<init>(
       at org.python.modules.time.Time.strptime(
       at sun.reflect.NativeMethodAccessorImpl.invoke0(Native Method)
       at sun.reflect.NativeMethodAccessorImpl.invoke(
       at sun.reflect.DelegatingMethodAccessorImpl.invoke(
       at java.lang.reflect.Method.invoke(

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.
Jython-users mailing list