[ python-Bugs-809254 ] imp.find_module doesn't work in /tmp

SourceForge.net noreply at sourceforge.net
Thu Aug 3 15:42:49 CEST 2006


Bugs item #809254, was opened at 2003-09-19 09:44
Message generated for change (Comment added) made by akuchling
You can respond by visiting: 
https://sourceforge.net/tracker/?func=detail&atid=105470&aid=809254&group_id=5470

Please note that this message will contain a full copy of the comment thread,
including the initial issue submission, for this request,
not just the latest update.
Category: Python Library
>Group: Python 2.5
Status: Open
Resolution: None
Priority: 5
Submitted By: Victor T. Ng (vng1)
Assigned to: Nobody/Anonymous (nobody)
Summary: imp.find_module doesn't work in /tmp

Initial Comment:
I'm running OSX 10.2.6 and the imp module seems to 
have a parsing error when I pass it the directory "/"

bash$ cd /tmp
bash$ touch __init__.py
bash$ python
Python 2.3 (#2, Jul 30 2003, 11:45:28) 
[GCC 3.1 20020420 (prerelease)] on darwin
Type "help", "copyright", "credits" or "license" for more 
information.
>>> import imp
>>> imp.find_module("tmp",['/'])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named tmp
>>> imp.find_module("tmp",['//'])
(None, '//tmp', ('', '', 5))

I'm not sure why, but I seem to need a double slash in the 
directory name.

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

>Comment By: A.M. Kuchling (akuchling)
Date: 2006-08-03 09:42

Message:
Logged In: YES 
user_id=11375

Still present in 2.5 on MacOS; still not present on Linux.


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

Comment By: Victor T. Ng (vng1)
Date: 2005-01-10 19:32

Message:
Logged In: YES 
user_id=679596

No problems under Python 2.4 on Linux:

Python 2.4 (#3, Dec 29 2004, 10:03:34) 
[GCC 3.3.4 (Debian 1:3.3.4-13)] on linux2
Type "help", "copyright", "credits" or "license" for more
information.
>>> import imp
>>> imp.find_module('tmp',['/'])
(None, '/tmp', ('', '', 5))
>>> 

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

Comment By: Victor T. Ng (vng1)
Date: 2005-01-10 19:31

Message:
Logged In: YES 
user_id=679596

Affects both Python 2.3 and Python 2.4 on OSX:

Python 2.4 (#1, Dec 25 2004, 15:45:34) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1671)] on darwin
Type "help", "copyright", "credits" or "license" for more
information.
>>> import imp
>>> imp.find_module('tmp', ['/'])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named tmp
>>> 

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

Comment By: Victor T. Ng (vng1)
Date: 2005-01-10 19:29

Message:
Logged In: YES 
user_id=679596

lima:~ buildbox$ cd /tmp
lima:/tmp buildbox$ touch __init__.py
lima:/tmp buildbox$ python
Python 2.3 (#1, Sep 13 2003, 00:49:11) 
[GCC 3.3 20030304 (Apple Computer, Inc. build 1495)] on darwin
Type "help", "copyright", "credits" or "license" for more
information.
>>> import imp
>>> imp.find_module("tmp", ['/'])
Traceback (most recent call last):
  File "<stdin>", line 1, in ?
ImportError: No module named tmp
>>> 

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

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


More information about the Python-bugs-list mailing list