[ python-Bugs-1029475 ] PEP 302 loader not carried through by reload function

SourceForge.net noreply at sourceforge.net
Thu Sep 16 22:41:44 CEST 2004


Bugs item #1029475, was opened at 2004-09-16 15:35
Message generated for change (Comment added) made by filitov
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1029475&group_id=5470

Category: Python Interpreter Core
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Stephen Haberman (filitov)
Assigned to: Phillip J. Eby (pje)
Summary: PEP 302 loader not carried through by reload function

Initial Comment:
This is based on bug 856103 "reload() fails with
modules from zips", but only a fix for the PEP 302
loaders not being used in reload.

There are other issues with reloading zip files,
specifically when the size of the zip changes, new
buffers are not created, but that is a separate issue
and dealt with in bug 856103 instead of here.

----

This patch just modifies import.c's
PyImport_ReloadModule to use a loader argument to
find_module and load_module.

A few things to note:

1) After my original 856103 patch was made, the path
parameter to find_module now has to be non null. This
path variable was only being set in the subname != NULL
case off of the parent, so I copied the logic to get
the path off of the existing module in the subname ==
NULL case. This seems to work.

2) I was fairly sure with my original 856103 patch,
"reload(mod)" and then "mod.newFunction()" would work.
But now the test case has to do "mod = reload(mod)" for
the "newFunction()" call to work.

I do not know whether this is related to something in
this patch or not.


----------------------------------------------------------------------

>Comment By: Stephen Haberman (filitov)
Date: 2004-09-16 15:41

Message:
Logged In: YES 
user_id=642545

Attached the patch with a better test case.

----------------------------------------------------------------------

Comment By: Stephen Haberman (filitov)
Date: 2004-09-16 15:37

Message:
Logged In: YES 
user_id=642545

Trying to upload the patch.

----------------------------------------------------------------------

You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=1029475&group_id=5470


More information about the Python-bugs-list mailing list