This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author glchapman
Recipients
Date 2002-04-25.21:08:39
SpamBayes Score
Marked as misclassified
Message-id
In-reply-to
Content
Logged In: YES 
user_id=86307

I just ran into this today when trying to find out why 
pydoc wasn't working for a module of mine: 
inspect.getmodule calls os.abspath with the filename found 
in the code object of global functions.  If the cwd is 
different than when the code object was compiled, 
inspect.getmodule fails.

Anyway, it looks to me like most of these relative paths 
could be caught in the find_module function (of import.c) 
if, when given an empty string for a path (while iterating 
over sys.path), find_module called getcwd() and used that 
instead of the empty string.  Of course, this assumes that 
(on all platforms) opening a bare filename means open the 
file with that name in the current directory (is that a 
valid assumption?).  Also, it appears from posixmodule.c 
that getcwd may not always be available.

Does this sound like a reasonable idea?
History
Date User Action Args
2007-08-23 13:53:50adminlinkissue415492 messages
2007-08-23 13:53:50admincreate