[issue26539] frozen executables should have an empty path

2021-10-21 Thread Irit Katriel


Change by Irit Katriel :


--
resolution:  -> fixed
stage:  -> resolved
status: open -> closed

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26539] frozen executables should have an empty path

2019-09-25 Thread STINNER Victor


STINNER Victor  added the comment:

The PEP 587 has been implemented in Python 3.8. The new API allows to 
initialize sys.path to a really empty list: sys.path = [].

* https://docs.python.org/dev/c-api/init_config.html
* 
https://docs.python.org/dev/c-api/init_config.html#c.PyConfig.module_search_paths

--
nosy: +vstinner

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com



[issue26539] frozen executables should have an empty path

2016-03-11 Thread Daniel Shaulov

New submission from Daniel Shaulov:

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.

--
components: Demos and Tools
files: freeze_path.patch
keywords: patch
messages: 261566
nosy: Daniel Shaulov, twouters
priority: normal
severity: normal
status: open
title: frozen executables should have an empty path
type: enhancement
versions: Python 3.5, Python 3.6
Added file: http://bugs.python.org/file42133/freeze_path.patch

___
Python tracker 

___
___
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com