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 Daniel Shaulov
Recipients Daniel Shaulov, twouters
Date 2016-03-11.13:03:40
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1457701421.75.0.0409884963304.issue26539@psf.upfronthosting.co.za>
In-reply-to
Content
A frozen python executable should have an empty path, so it doesn't accidentally run something it was not supposed to.

The attached file achieves that by setting Py_NoSiteFlag and Py_IsolatedFlag in Python/frozenmain.c

It also checks for Py_FrozenFlag in Python/sysmodule.c in makepathobject and just returns an empty list if it is set.

I originally tried doing it without changing sysmodule, by calling Py_SetPath as suggested in the comment in getpath.c, but calling Py_SetPath(L"") will leave me with a path that cointains a single empty string. There is no way to set an empty path with Py_SetPath.

Other options include allowing Py_SetPath to accept NULL and making sure that NULL results in an empty list, or changing the behavior of makepathobject so an empty string will result in an empty list instead of a list with an empty string.
History
Date User Action Args
2016-03-11 13:03:41Daniel Shaulovsetrecipients: + Daniel Shaulov, twouters
2016-03-11 13:03:41Daniel Shaulovsetmessageid: <1457701421.75.0.0409884963304.issue26539@psf.upfronthosting.co.za>
2016-03-11 13:03:41Daniel Shaulovlinkissue26539 messages
2016-03-11 13:03:41Daniel Shaulovcreate