Message269379
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 fine 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')))
Related Issue: Issue17408 ("second python execution fails when embedding") |
|
Date |
User |
Action |
Args |
2016-06-27 13:49:18 | Denny Weinberg | set | recipients:
+ Denny Weinberg, palm.kevin |
2016-06-27 13:49:18 | Denny Weinberg | set | messageid: <1467035358.55.0.678180807375.issue27400@psf.upfronthosting.co.za> |
2016-06-27 13:49:18 | Denny Weinberg | link | issue27400 messages |
2016-06-27 13:49:18 | Denny Weinberg | create | |
|