[Python-ideas] 'from os.path import FILE, DIR' or internal structure of filenames

anatoly techtonik techtonik at gmail.com
Sun Sep 29 19:36:06 CEST 2013

On Sun, Sep 29, 2013 at 9:15 AM, Nick Coghlan <ncoghlan at gmail.com> wrote:
> On 29 September 2013 13:28, INADA Naoki <songofacandy at gmail.com> wrote:
>> 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.
> Hence the part about any remaining instances of non-absolute __file__
> values being considered a bug in the import system.

Bug that will not be fixed, i.e. a wart.

And as a result we don't have a way to reliably reference filename
of the current script and its directory. Hence the proposal.
anatoly t.

More information about the Python-ideas mailing list