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
Date 2017-03-05.22:00:47
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1488751247.85.0.360824935284.issue29723@psf.upfronthosting.co.za>
In-reply-to
Content
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.
History
Date User Action Args
2017-03-05 22:00:47eryksunsetrecipients: + eryksun, ncoghlan, nedbat, ned.deily
2017-03-05 22:00:47eryksunsetmessageid: <1488751247.85.0.360824935284.issue29723@psf.upfronthosting.co.za>
2017-03-05 22:00:47eryksunlinkissue29723 messages
2017-03-05 22:00:47eryksuncreate