Author eryksun
Recipients eryksun, ncoghlan, ned.deily, nedbat, steve.dower
Date 2017-03-08.07:19:11
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488957552.04.0.539091258414.issue29723@psf.upfronthosting.co.za>
In-reply-to
Content
> 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.
History
Date User Action Args
2017-03-08 07:19:12eryksunsetrecipients: + eryksun, ncoghlan, nedbat, ned.deily, steve.dower
2017-03-08 07:19:12eryksunsetmessageid: <1488957552.04.0.539091258414.issue29723@psf.upfronthosting.co.za>
2017-03-08 07:19:12eryksunlinkissue29723 messages
2017-03-08 07:19:11eryksuncreate