[issue34444] Module's __file__ should be absolute always ("." in sys.path)

daniel hahler report at bugs.python.org
Tue Dec 24 13:29:34 EST 2019


daniel hahler <python-bugs at thequod.de> added the comment:

> And changing this to have to check every time import runs if an entry in sys.path is absolute would be costly (that's not a insignificant number of stat calls which we always try to avoid during import when possible).

This could be done when inserting something into `sys.path` maybe then only?
But might only make sense when there is some special handling in that case already though - and would change existing behavior of course.
(Therefore I am OK with rejecting this, but wanted to mention it anyway)

> Your best option is to insert an absolute path to begin with.

That's a good enough option to have anyway, of course.

----------

_______________________________________
Python tracker <report at bugs.python.org>
<https://bugs.python.org/issue34444>
_______________________________________


More information about the Python-bugs-list mailing list