This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author Denny Weinberg
Recipients Arfrever, Denny Weinberg, amaury.forgeotdarc, isoschiz, ncoghlan, ned.deily, palm.kevin, pconnell, pitrou, python-dev, terry.reedy, theDarkBrainer
Date 2016-05-19.08:32:43
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1463646763.96.0.980759988256.issue17408@psf.upfronthosting.co.za>
In-reply-to
Content
Hi,

I think that the problem exists also in python 3.5.1

After calling Py_Finalize and Py_Initialize I get the message "attribute of type 'NoneType' is not callable" on the datetime.strptime method.

Example:
from datetime import datetime
s = '20160505 160000'
refdatim = datetime.strptime(s, '%Y%m%d %H%M%S')

The first call works find but it crashes after the re initialization.

Workaround:
from datetime import datetime
s = '20160505 160000'
try:
    refdatim = datetime.strptime(s, '%Y%m%d %H%M%S')
except TypeError:
    import time
    refdatim = datetime.fromtimestamp(time.mktime(time.strptime(s, '%Y%m%d %H%M%S')))

Can anyone confirm this bug? Can you tell me if this will be fixed for python 3.5/3.6/...?

All the other modules are working find after the re initialization but datetime.strptime.
History
Date User Action Args
2016-05-19 08:32:44Denny Weinbergsetrecipients: + Denny Weinberg, terry.reedy, amaury.forgeotdarc, ncoghlan, pitrou, ned.deily, Arfrever, palm.kevin, python-dev, pconnell, theDarkBrainer, isoschiz
2016-05-19 08:32:43Denny Weinbergsetmessageid: <1463646763.96.0.980759988256.issue17408@psf.upfronthosting.co.za>
2016-05-19 08:32:43Denny Weinberglinkissue17408 messages
2016-05-19 08:32:43Denny Weinbergcreate