This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: C modules reloaded on certain failed imports
Type: Stage:
Components: Interpreter Core Versions: Python 2.6
process
Status: closed Resolution: out of date
Dependencies: Superseder:
Assigned To: brett.cannon Nosy List: brett.cannon, josiahcarlson
Priority: normal Keywords:

Created on 2006-08-29 16:09 by josiahcarlson, last changed 2022-04-11 14:56 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
import_bug.zip josiahcarlson, 2006-08-29 16:09 sample failure for 2.3 and 2.4
Messages (2)
msg29708 - (view) Author: Josiah Carlson (josiahcarlson) * (Python triager) Date: 2006-08-29 16:09
Running z.py in the attached archive should produce an
attribute error on printing, as we have set sys.stdout
to None.  On 2.3.5 and 2.4.3, output is printed and any
imported C modules in x/y.py are reloaded, builtin or
3rd party.

On 2.5, we get a traceback on import: "SystemError:
Parent module 'x' not loaded".

Changing the name on the import from 'x.y' to 'y'
works-around the error, and we get the expected
AttributeError in 2.3, 2.4.  2.5 gives us the same
SystemError.
msg85072 - (view) Author: Brett Cannon (brett.cannon) * (Python committer) Date: 2009-04-01 18:49
Trunk has this printing AttributeError as Josiah suggests should happen,
so closing as out of date.
History
Date User Action Args
2022-04-11 14:56:19adminsetgithub: 43911
2009-04-01 18:49:35brett.cannonsetstatus: open -> closed
resolution: out of date
messages: + msg85072
2009-02-11 03:09:25ajaksu2setassignee: brett.cannon
nosy: + brett.cannon
versions: + Python 2.6, - Python 2.5
2008-01-04 01:55:46christian.heimessetversions: + Python 2.5, - Python 2.3
2006-08-29 16:09:11josiahcarlsoncreate