Eryk Sun added the comment:

> It's actually "adding" the current directory

It's the script directory, which gets added on all platforms when PySys_SetArgv 
is called with Py_IsolatedFlag == 0. In this case we're running "__main__.py" 
from a directory or zip file, and we don't want its parent directory in 
sys.path.

> The behavior on Windows is correct 

Here's what I see on a current build of 3.6:

    C:\Temp>python_d -i main361
    >>> import sys
    >>> sys.version
    '3.6.0+ (default, Mar  8 2017, 06:51:22) [MSC v.1900 64 bit (AMD64)]'
    >>> sys.path[:2]
    ['main361', 'C:\\Temp']

C:\Temp doesn't belong in sys.path in this case. When we're not in isolated 
mode, RunMainFromImporter should set the __main__.py import source as index 0 
rather than insert it.

----------

_______________________________________
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