Eryk Sun added the comment:

That's not the current directory. It's the 'script' directory (i.e. the parent 
of main361), as set by PySys_SetArgv when Py_IsolatedFlag isn't set. 

The old behavior was for RunMainFromImporter to unconditionally replace this 
directory in sys.path with the import source for "__main__.py", which is the 
correct behavior, except I think it should try to get an absolute path. The 
resolution for #29319 changed this such that when sys.path[0] is non-empty it 
now inserts the import source at index 0 rather than replace index 0. It seems 
to me that this new logic should only be used in isolated mode. Otherwise it 
should be replacing this bogus script directory like it used to.

----------
nosy: +eryksun

_______________________________________
Python tracker <rep...@bugs.python.org>
<http://bugs.python.org/issue29723>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to