[New-bugs-announce] [issue30814] Import dotted name as alias breaks with concurrency

Samuele Santi report at bugs.python.org
Fri Jun 30 07:09:48 EDT 2017


New submission from Samuele Santi:

I noticed this weird behavior in Python 3.6:

Apparently ``import package.module as _alias`` fails in a threaded environment, sometimes raising an ``ImportError``, seemingly at random.

Everything seems to be working perfectly fine:

- On 3.5 and lower
- When *not* defining an alias, eg. ``import package.module``
- When using the ``from package import module as alias`` style


See this repo with code for reproducing the issue:

https://github.com/rshk/python36-import-alias-concurrency-bug


I tested this on the system Python 3.6.1 shipped with Archlinux (both inside and outside of a virtualenv), and in the official docker image for 3.6.

This all started here https://github.com/psycopg/psycopg2/issues/550 as others were experiencing this issue too.

----------
messages: 297380
nosy: Samuele Santi2
priority: normal
severity: normal
status: open
title: Import dotted name as alias breaks with concurrency
versions: Python 3.6

_______________________________________
Python tracker <report at bugs.python.org>
<http://bugs.python.org/issue30814>
_______________________________________


More information about the New-bugs-announce mailing list