Denny Weinberg added the comment:
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.
----------
nosy: +Denny Weinberg
versions: +Python 3.5
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue17408>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com