Changing the default in Python was discussed multiple times over the
last 20 years. Every time, it was said that it's convenient and it's
not worth it to break use cases to increase the default security.
Python 3.4 already has -I (isolated mode) which imply Python 3.11 -P
option, but it also implies other options like -E which ignores
environment variables, and so cannot be used for Fedora use cases
(shebangs).
I'm thinking about proposing a PEP to change the defaut in Python
3.12, but I'm not confident that it would be accepted. It's more to
write down the rationale once ;-)
Victor
On Wed, May 11, 2022 at 10:32 PM Miro Hrončok <mhroncok(a)redhat.com> wrote:
On 11. 05. 22 16:24, Robbie Harwood wrote:
> Ben Cotton <bcotton(a)redhat.com> writes:
>
>> :Don’t prepend a potentially unsafe path to `sys.path`:
>
> If this is a safety/security issue, why not just make it the default for
> python itself?
I would like that, but -P is what we have now. If we pioneer this in Fedora,
maybe we can convince upstream to make that the default, however,
backwards-compatibility matters to many people and while I would appreciate
such change, I don't really want to to drive it. Victor (the second change
owner) might want to persuade that path, but it ain't gonna happen in Python 3.11.
--
Miro Hrončok
--
Phone: +420777974800
IRC: mhroncok