[Patches] [ python-Patches-841977 ] modulefinder fails to find extension modules in packages

SourceForge.net noreply at sourceforge.net
Fri Nov 14 04:35:22 EST 2003


Patches item #841977, was opened at 2003-11-14 09:35
Message generated for change (Comment added) made by jvr
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=841977&group_id=5470

Category: Library (Lib)
Group: None
Status: Open
Resolution: None
Priority: 5
Submitted By: Thomas Heller (theller)
>Assigned to: Thomas Heller (theller)
Summary: modulefinder fails to find extension modules in packages

Initial Comment:
The find_all_submodules() method in modulefinder only
looks for *.py, *.pyc, and *.pyo files.  Python
extension modules are only found if they are referenced
in import statements somewhere.

This patch uses the actual list from imp.get_suffixes().

Assigning to Just - can you verify that this does the
right thing? If needed I can provide a simple program
which shows this bug when frozen in py2exe, I assume
BundleBuilder would have the same problem.


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

>Comment By: Just van Rossum (jvr)
Date: 2003-11-14 10:35

Message:
Logged In: YES 
user_id=92689

I don't think it's needed to add .pyc and .pyo to the suffixes list: 
most of the time a .py is needed anyway, and the standard 
import mechanism doesn't find a module if there's no source and 
the byte code extension doesn't match the optimization setting. I 
mean, when running with -O, you'll get an ImportError if there's 
only a .pyc and vice versa. So the suffixes from 
imp.get_suffixes() should be enough. Other than that: go ahead 
and check it in, preferably also in the 2.3 maintainance branch.

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

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



More information about the Patches mailing list