[Patches] [ python-Patches-685268 ] imputil must respect __path__ for package submodules
SourceForge.net
noreply@sourceforge.net
Wed, 12 Feb 2003 03:58:26 -0800
Patches item #685268, was opened at 2003-02-12 12:51
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=685268&group_id=5470
Category: Library (Lib)
Group: Python 2.3
Status: Open
Resolution: None
Priority: 5
Submitted By: Soeren Fietzke (sfiet)
Assigned to: Nobody/Anonymous (nobody)
Summary: imputil must respect __path__ for package submodules
Initial Comment:
The imputil module does not look at the __path__
member of a package to find sub-modules.
To reproduce, create a package with a submodule, i.e.
directory structure like this:
p1/
__init__.py
sub/
spam.py
contents of __init__.py:
import os
__path__.append(os.path.join(__path__[0], 'sub'))
import spam
contents of spam.py:
print 'imported spam'
Doing an "import p1" in a fresh Python session will
succeed.
However, after loading and installing imputil, it will fail:
import imputil
imputil._test_revamp()
import p1 # <-- will not find module spam
----------------------------------------------------------------------
>Comment By: Soeren Fietzke (sfiet)
Date: 2003-02-12 12:58
Message:
Logged In: YES
user_id=710276
Oops, spaces were stripped out, so just to clarify: 'sub'
should be a subdirectory of 'p1' in the above example:
p1/__init__.py
p1/sub/spam.py
----------------------------------------------------------------------
You can respond by visiting:
https://sourceforge.net/tracker/?func=detail&atid=305470&aid=685268&group_id=5470