Message4217
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?
|
|
Date |
User |
Action |
Args |
2007-08-23 13:53:50 | admin | link | issue415492 messages |
2007-08-23 13:53:50 | admin | create | |
|