On 3/13/23, Rokas Kupstys <rokups...@gmail.com> wrote:
> I eventually stumbled on to process list showing
> ".venv/Scripts/python.exe" having spawned a subprocess... Which led me
> to "PC/launcher.c" which is what ".venv/Scripts/python.exe" really is.

For a standard Python installation, you can create a virtual
environment with the --symlinks option instead of the default
configuration that uses the venv launcher. Note, however, that using
symlinks doesn't work with the store app distribution of Python.

If your system doesn't have developer mode enabled, creating symlinks
requires "SeCreateSymbolicLinkPrivilege". By default this privilege is
only granted to administrators. However, an administrator can use the
management console "secpol.msc" snap-in to grant the symlink privilege
directly to a user account, or to one of the account's default enabled
groups such as "Authenticated Users". Add the user or group to the
"Create symbolic links" policy in "Security Settings" -> "Local
Policies" -> "User Rights Assignment". You'll have to log off and back
on again to get a new access token that has the symlink privilege.

Unfortunately, the shell API -- e.g. os.startfile() -- resolves the
final path of an executable before running it. This allows using
filesystem symlinks as if they're shortcuts (LNK files), but it
prevents using a symlink to change the name or path of an executable
to get different expected behavior, such as a Python virtual
environment that uses symlinks.
_______________________________________________
Python-Dev mailing list -- python-dev@python.org
To unsubscribe send an email to python-dev-le...@python.org
https://mail.python.org/mailman3/lists/python-dev.python.org/
Message archived at 
https://mail.python.org/archives/list/python-dev@python.org/message/3PJJDU6WVNV7K65RZEDMBERCCAVIS5P6/
Code of Conduct: http://python.org/psf/codeofconduct/

Reply via email to