[New-bugs-announce] [issue38884] __import__ is not thread-safe on Python 3

Valentyn Tymofieiev report at bugs.python.org
Thu Nov 21 14:11:54 EST 2019


New submission from Valentyn Tymofieiev <valentyn at google.com>:

Attached import_module_not_found.py consistently fails for me on Python 3.7.5 and earlier Python 3 versions that I have tried with 

  File "/usr/lib/python3.7/threading.py", line 926, in _bootstrap_inner
    self.run()
  File "/usr/lib/python3.7/threading.py", line 870, in run
    self._target(*self._args, **self._kwargs)
  File "import_module_not_found.py", line 8, in t2
    return __import__("tensorflow.estimator", level=0)
ModuleNotFoundError: No module named 'tensorflow.estimator

Threads in this example finish successfully if executed sequentially.

I have not tried higher versions of Python, but I cannot reproduce this on Python 2.7. 

Is this an expected behavior?

Thank you.

----------
files: import_module_not_found.py
messages: 357198
nosy: Valentyn Tymofieiev
priority: normal
severity: normal
status: open
title: __import__ is not thread-safe on Python 3
versions: Python 3.7
Added file: https://bugs.python.org/file48734/import_module_not_found.py

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue38884>
_______________________________________


More information about the New-bugs-announce mailing list