[Python-ideas] 'from os.path import FILE, DIR' or internal structure of filenames
songofacandy at gmail.com
Sun Sep 29 05:28:45 CEST 2013
os.path.abspath(__file__) returns wrong path after chdir.
So I don't think abspath of module can be trivially and reliably derived
from existing values.
$ cat foo.py
$ python foo.py
On Sun, Sep 29, 2013 at 9:21 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> Note that any remaining occurrences of non-absolute values in __file__ are
> generally considered bugs in the import system. However, we tend not to fix
> them in maintenance releases, since converting relative paths to absolute
> paths runs a risk of breaking user code.
> We're definitely *not* going to further pollute the module namespace with
> values that can be trivially and reliably derived from existing values.
> Python-ideas mailing list
> Python-ideas at python.org
INADA Naoki <songofacandy at gmail.com>
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the Python-ideas