Title: time.strptime should throw an exception when format doesn't match
Type: behaviour Severity: normal
Components: Versions: Jython 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, amak, dbeckwith, fwierzbicki, zyasoft
Priority: low Keywords:

Created on 2010-12-31.00:48:00 by dbeckwith, last changed 2014-06-19.07:58:03 by zyasoft.

msg6308 (view) Author: David Beckwith (dbeckwith) Date: 2010-12-31.00:48:00
import time
# Note that the format doesn't match.
# There should be dashes in the format.
# However, instead of giving an exception like in cpython, jython gives an
#  incorrect value.

jython -c "import time; print time.strptime('2010-12-25 00:00:00', '%Y%m%d')"
(2009, 11, 2, 0, 0, 0, 0, 306, -1)

python -c "import time; print time.strptime('2010-12-25 00:00:00', '%Y%m%d')"
Traceback (most recent call last):
  File "<string>", line 1, in <module>
  File "/usr/lib64/python2.6/", line 454, in _strptime_time
    return _strptime(data_string, format)[0]
  File "/usr/lib64/python2.6/", line 325, in _strptime
    (data_string, format))
ValueError: time data '2010-12-25 00:00:00' does not match format '%Y%m%d'
msg8745 (view) Author: Jim Baker (zyasoft) Date: 2014-06-19.07:58:03
This issue has been fixed at some point, with a ValueError being raised, so closing out
Date User Action Args
2014-06-19 07:58:03zyasoftsetstatus: open -> closed
resolution: fixed
messages: + msg8745
nosy: + zyasoft
versions: + Jython 2.7, - Jython 2.5
2013-02-20 00:02:37fwierzbickisetpriority: low
nosy: + fwierzbicki
versions: + Jython 2.5, - 2.5.2rc
2012-08-28 22:04:19amaksetnosy: + amak
2012-08-28 07:54:19Arfreversetnosy: + Arfrever
2010-12-31 00:48:00dbeckwithcreate