Fix python2 AttributeError with strptime
Fix a potential python2 error when calling strptime, the first call to strptime is not thread safe and might trigger an exception. A workaround was added by calling strptime before creating a thread but the caller is itself within a thread, so it may fail. The workaround is now to explicitly import _strptime as described in the upstream python issue https://bugs.python.org/issue7980 Note: This commit only applies to branches that support python2 (initial commit in stable/train) Story 2008211 Task 40997 Change-Id: I0e7119d5a379f8662c4913d7232ef28535a29b32
This commit is contained in:
parent
8c32d2e602
commit
5a69da392f
|
@ -16,6 +16,9 @@
|
|||
import concurrent.futures
|
||||
import datetime
|
||||
|
||||
# work around for https://bugs.python.org/issue7980
|
||||
import _strptime # noqa: F401 pylint: disable=unused-import
|
||||
|
||||
from oslo_config import cfg
|
||||
from taskflow import engines as tf_engines
|
||||
|
||||
|
|
|
@ -0,0 +1,6 @@
|
|||
---
|
||||
fixes:
|
||||
- |
|
||||
Fix a potential AttributeError exception at init time in the housekeeping
|
||||
service when using python2 because of an issue with thread safety when
|
||||
calling strptime for the first time.
|
Loading…
Reference in New Issue