Issue 7140: imp.new_module does not function correctly if the module is returned from a function and used directly (original ) (raw ) Issue7140
Created on 2009-10-15 11:24 by jkp , last changed 2022-04-11 14:56 by admin . This issue is now closed .
Files
File name
Uploaded
Description
Edit
testcase.py
jkp,2009-10-15 11:24
Testcase demonstrating the issue.
testcase.py
jkp,2009-10-15 11:34
Messages (7)
msg94082 - (view)
Author: Jamie Kirkpatrick (jkp)
Date: 2009-10-15 11:24
See the testcase included. If you instead assign the result of the get_module() call to a variable and then make the call to the function defined in that module it works as expected.
msg94083 - (view)
Author: Jamie Kirkpatrick (jkp)
Date: 2009-10-15 11:34
Updated the testcase to show that the __dict__ for the module is incorrect unless the module is assigned to a temp variable.
msg94095 - (view)
Author: Benjamin Peterson (benjamin.peterson) *
Date: 2009-10-15 15:45
Fixed in r75437 .
msg118480 - (view)
Author: Benjamin Peterson (benjamin.peterson) *
Date: 2010-10-12 22:58
Rebroken in r85392 . See #10068 .
msg118819 - (view)
Author: Terry J. Reedy (terry.reedy) *
Date: 2010-10-15 18:40
Since that revision only touched py3k, I am guessing that it only broke 3.2.
msg121213 - (view)
Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) *
Date: 2010-11-15 01:51
But there were r85393 (2.7) and r85394 (3.1).
msg193992 - (view)
Author: Antoine Pitrou (pitrou) *
Date: 2013-07-31 09:36
Work in progress in issue 18214 .
History
Date
User
Action
Args
2022-04-11 14:56:54
admin
set
github: 51389
2013-07-31 09:36:01
pitrou
set
status: open -> closednosy: + pitrou messages: + superseder: Stop purging modules which are garbage collected before shutdown resolution: duplicate
2010-11-15 01:51:49
Arfrever
set
nosy: + Arfrever messages: + versions: + Python 3.1, Python 2.7
2010-10-15 18:40:42
terry.reedy
set
nosy: + terry.reedy messages: + versions: + Python 3.2, - Python 2.6, Python 2.5
2010-10-12 22:58:22
benjamin.peterson
set
status: closed -> openresolution: fixed -> (no value)messages: +
2009-10-15 15:45:25
benjamin.peterson
set
status: open -> closednosy: + benjamin.peterson messages: + resolution: fixed
2009-10-15 11:34:07
jkp
set
files: + testcase.py messages: +
2009-10-15 11:24:51
jkp
create