Terry J. Reedy <[email protected]> added the comment:
An implementation note mostly to myself: In 3.8 and before, 'python
relative/path/to/file.py' results in the __file__ attribute of the main module
being the relative path, and a possibly unnormalized full path is os.curdir +
__file__. I believe that this is the only situation in which __file__ is not
absolute. After os.chdir(new cwd), relative __file__ becomes useless unless
the original curdir is saved or __file__ is made absolute first. The startup
part of pyshell has this vulnerable line.
icondir = os.path.join(os.path.dirname(__file__), 'Icons')
But with curdir left alone when starting from a command line, there will be no
problem.
----------
_______________________________________
Python tracker <[email protected]>
<https://bugs.python.org/issue22121>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com