New submission from Steve Dower <steve.do...@python.org>:

So I'm totally sick of being abused on the internet about the whole PATH issue, 
and want to put this up as an alternative. I'm willing to do the work, but I'm 
worried that my emotional state about the whole thing is blinding me to obvious 
issues.

In short, add a new option to the installer to "Add global python3.exe and 
python.exe commands". Also replace the current PATH option on the first page 
(not under Customize) with this. I'll also embed a "Learn More" link to the 
(new) doc page that explains the impact.

The option will pass an extra flag to the *launcher* installer to include more 
copies of py.exe, renamed to python3.exe and python.exe (we already pass a 
similar option to add file associations). These additional copies will be just 
as global as py.exe (depending on whether the user is admin or not) and 
obviously work identically.

Importantly, this does *not* drop an arbitrary/writable directory on PATH, and 
it keeps the DLLs out of the search path. 

There are some risks:
* these may overtake people's existing installs and replace them with something 
more clever (this annoys people)
* these add an extra process in the chain, which can break callers who need the 
process ID/handle (this annoys people)
* this won't put Scripts on PATH (this annoys people)
* changing anything at all annoys people
* would remove python3.dll and python39.dll from PATH (probably for the best), 
and also vcruntime*.dll (which is a *good* thing) and anything installed by 
packages/tools into sys.prefix (which is a *massive* security vulnerability)
* the help text for the launcher is not obvious above the help for the default 
Python interpreter
* shebang lines will start being noticed
* things should work in a venv because of both PATH and VIRTUALENV variables, 
but I'm not going to stake my life on this
* "python3.exe" could launch Python 2, but I'm not too concerned by this

I feel like this option is the best of a bad lot. But if people weigh in and 
say it's worse than doing nothing, then I'll do nothing.

(Including Ɓukasz in case he wants to veto adding this to 3.9 after beta 1. 
It's not a language change, and barely even an installer change - just a few 
optional copies of the existing launcher plus some docs. But as I mentioned 
above it *will* break some people.)

----------
components: Windows
messages: 369196
nosy: lukasz.langa, paul.moore, steve.dower, tim.golden, zach.ware
priority: normal
severity: normal
status: open
title: [Windows] Add global python and python3 commands
type: enhancement
versions: Python 3.9

_______________________________________
Python tracker <rep...@bugs.python.org>
<https://bugs.python.org/issue40667>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe: 
https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com

Reply via email to