[issue15386] Still getting two copies of importlib._bootstrap

2019-07-14 Thread STINNER Victor


STINNER Victor  added the comment:


New changeset 8b7db5a1114e2113a756bdf8877fbe366055c69a by Victor Stinner in 
branch 'master':
bpo-37473: Don't import importlib ASAP in tests (GH-14661)
https://github.com/python/cpython/commit/8b7db5a1114e2113a756bdf8877fbe366055c69a


--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2019-07-09 Thread STINNER Victor


Change by STINNER Victor :


--
pull_requests: +14469
pull_request: https://github.com/python/cpython/pull/14661

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-20 Thread Roundup Robot

Roundup Robot devn...@psf.upfronthosting.co.za added the comment:

New changeset 4431dc4bb770 by Nick Coghlan in branch 'default':
Close #15386: There was a loophole that meant importlib.machinery and imp would 
sometimes reference an uninitialised copy of importlib._bootstrap
http://hg.python.org/cpython/rev/4431dc4bb770

--
nosy: +python-dev
resolution:  - fixed
stage: test needed - committed/rejected
status: open - closed

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-20 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

That was a *lot* harder than I expected to create a test for - I had to import 
importlib right at the start of regrtest, as well as tweak the import order in 
runpy, and doing so actually caused test_import to *crash* completely without 
the bug fixed.

The trick was realising that *anything* importing imp before importlib would 
mask the bug.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-19 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
assignee:  - ncoghlan

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-19 Thread Meador Inge

Changes by Meador Inge mead...@gmail.com:


--
nosy: +meador.inge

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Nick Coghlan

Changes by Nick Coghlan ncogh...@gmail.com:


--
title: Still getting two copies of importlib._boostrap - Still getting two 
copies of importlib._bootstrap

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

I would have said that it wasn't because it was just the class type not picking 
up on the __name__ re-assignment, but that global name failure states otherwise.

--
nosy: +brett.cannon

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Yup. A simpler demonstration:

Python 3.3.0b1 (default:8bf691d0b004+, Jul 15 2012, 23:20:06) 
[GCC 4.7.0 20120507 (Red Hat 4.7.0-5)] on linux
Type help, copyright, credits or license for more information.
 from importlib import _bootstrap, machinery
 _bootstrap.FileFinder is machinery.FileFinder
False

My initial theory (a missing sys.modules entry) failed miserably, as 
import.__init__ already has the following line:

sys.modules['importlib._bootstrap'] = _bootstrap

I'm guessing it has to be some weird interaction with the explicit relative 
import, but I would have expected that to pick up on either the parent module 
attribute or the sys.modules entry.

--

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Nick Coghlan

Nick Coghlan ncogh...@gmail.com added the comment:

Checking with importlib.abc and importlib.util (which turned out not to have 
the problem) put me on the right path: the problem is the import of imp in 
importlib.__init__

What appears to be happening is that the interpreter sees the partially 
initialised importlib package, considers it good enough, and continues on with 
importing _bootstrap and machinery from source. Control eventually returns to 
__init__ and it overwrites the source version with the frozen version.

Changing the __init__ file to do import _imp instead (the same as what 
import_init does in the C code) was enough to fix it.

No patch yet - the actual fix is trivial, but it needs a test.

--
nosy: +georg.brandl
priority: normal - release blocker
stage:  - test needed
type:  - behavior

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Brett Cannon

Brett Cannon br...@python.org added the comment:

Nice catch! Obviously that needs a big comment to avoid that problem in the 
future.

--
versions: +Python 3.3

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue15386] Still getting two copies of importlib._bootstrap

2012-07-18 Thread Arfrever Frehtes Taifersar Arahesis

Changes by Arfrever Frehtes Taifersar Arahesis arfrever@gmail.com:


--
nosy: +Arfrever

___
Python tracker rep...@bugs.python.org
http://bugs.python.org/issue15386
___
___
Python-bugs-list mailing list
Unsubscribe: 
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com