This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

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 <>
> 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 "" 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 import source as index 0 rather than insert it.
Date User Action Args
2017-03-08 07:19:12eryksunsetrecipients: + eryksun, ncoghlan, nedbat, ned.deily, steve.dower
2017-03-08 07:19:12eryksunsetmessageid: <>
2017-03-08 07:19:12eryksunlinkissue29723 messages
2017-03-08 07:19:11eryksuncreate