Closed mminichino closed 3 days ago
The variable is not listed on https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables.
The referenced python-certifi-win32
is unmaintained, see https://pypi.org/project/python-certifi-win32/.
While I find some mentions of LOCALAPPDATA
on stackoverflow, I do not recognize a clear pattern why this should be included.
In #3151 @gaborbernat made the case that we happily include env variables that are required by the standard lib, but not app specific ones.
See the following for example. There are multiple references to this environment variable. That is with a quick Google search. https://learn.microsoft.com/en-us/windows/win32/msi/installation-contexthttps://learn.microsoft.com/en-us/windows/win32/shell/knownfolderid#FOLDERID_UserProgramFilesWhile that package may not be actively maintained, it is a dependency of many other packages. And that is only one example. I can imagine many in-house apps that run on Windows rely on this environment variable as well.On Oct 29, 2024, at 12:46 AM, Jürgen Gmach @.***> wrote: The variable is not listed on https://learn.microsoft.com/en-us/windows/deployment/usmt/usmt-recognized-environment-variables. The referenced python-certifi-win32 is unmaintained, see https://pypi.org/project/python-certifi-win32/. While I find some mentions of LOCALAPPDATA on stackoverflow, I do not recognize a clear pattern why this should be included. In #3151 @gaborbernat made the case that we happily include env variables that are required by the standard lib, but not app specific ones.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
My barrier of entry did not change. If it is required by a standard library method, we will add it. If it is not, even if it's a popular library from PyPI, we will not.
Can you help me understand what you mean by “standard library method”?On Oct 29, 2024, at 1:30 AM, Bernát Gábor @.***> wrote: Closed #3429 as not planned.
—Reply to this email directly, view it on GitHub, or unsubscribe.You are receiving this because you authored the thread.Message ID: @.***>
My last email reply was truncated, and one email reply seems to not have been posted.
Here is documentation from Microsoft on the Windows Win32 API that lists LOCALAPPDATA as "standard" from shellapi.h.
This blog post explains Windows installer target path logic including this environment variable.
Is there a method in the Python standard library that requires this environment to function correctly?
In my opinion you need to separate a language from the standard patterns found in operating systems where that language is commonly used. As a developer that writes software for users of an operating system, you have to follow the standard patterns found on that operating system. For POSIX based systems you can use the ubiquitous $HOME or tilde (~) to find user local paths. On Windows you have to use environment variables for software installed for either all users (APPDATA) or a single user (LOCALAPPDATA). In my humble opinion, I think you need to expand your definition of "standard" to include the target operating environment, not just Python itself.
That said, if you require a Python specific tie in, then please read Using Python on Windows from the official Python GitHub repo. It references this environment variable.
We will need to agree to disagree on this one. Also note that this doesn't stop you from using the tool, you just have to set that environmental variable in your configuration should you use a library requiring this environment variable. My definition of where I draw the line in the sand is not "mentioned in the documentation" but rather used by the Python interpreter itself or its standard library.
Issue
This is related to #3151 - LOCALAPPDATA is needed just as APPDATA is needed. It is a commonly used Windows environment variable and it is used by popular Python packages such as python-certifi-win32.
Environment
Output of running tox
Output of
```console ROOT: No tox.ini or setup.cfg or pyproject.toml or tox.toml found, assuming empty tox.ini at C:\Users\adminuser py: 598 I find interpreter for spec PythonSpec(path=C:\ProgramData\scoop\apps\python312\current\python.exe) [virtualenv\discovery\builtin.py:73] py: 598 D filesystem is not case-sensitive [virtualenv\info.py:25] py: 605 I proposed PythonInfo(spec=CPython3.12.7.final.0-64, exe=C:\ProgramData\scoop\apps\python312\current\python.exe, platform=win32, version='3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [virtualenv\discovery\builtin.py:80] py: 605 D accepted PythonInfo(spec=CPython3.12.7.final.0-64, exe=C:\ProgramData\scoop\apps\python312\current\python.exe, platform=win32, version='3.12.7 (tags/v3.12.7:0b05ead, Oct 1 2024, 03:06:41) [MSC v.1941 64 bit (AMD64)]', encoding_fs_io=utf-8-utf-8) [virtualenv\discovery\builtin.py:82] py: 610 D symlink on filesystem does not work [virtualenv\info.py:44] py: 1383 I create virtual environment via CPython3Windows(dest=C:\Users\adminuser\.tox\py, clear=False, no_vcs_ignore=False, global=False) [virtualenv\run\session.py:50] py: 1388 D create folder C:\Users\adminuser\.tox\py\Lib\site-packages [virtualenv\util\path\_sync.py:12] py: 1391 D create folder C:\Users\adminuser\.tox\py\Scripts [virtualenv\util\path\_sync.py:12] py: 1392 D write C:\Users\adminuser\.tox\py\pyvenv.cfg [virtualenv\create\pyenv_cfg.py:33] py: 1392 D home = C:\ProgramData\scoop\apps\python312\3.12.7 [virtualenv\create\pyenv_cfg.py:38] py: 1392 D implementation = CPython [virtualenv\create\pyenv_cfg.py:38] py: 1392 D version_info = 3.12.7.final.0 [virtualenv\create\pyenv_cfg.py:38] py: 1392 D virtualenv = 20.27.1 [virtualenv\create\pyenv_cfg.py:38] py: 1392 D include-system-site-packages = false [virtualenv\create\pyenv_cfg.py:38] py: 1392 D base-prefix = C:\ProgramData\scoop\apps\python312\3.12.7 [virtualenv\create\pyenv_cfg.py:38] py: 1392 D base-exec-prefix = C:\ProgramData\scoop\apps\python312\3.12.7 [virtualenv\create\pyenv_cfg.py:38] py: 1392 D base-executable = C:\ProgramData\scoop\apps\python312\3.12.7\python.exe [virtualenv\create\pyenv_cfg.py:38] py: 1392 D copy C:\ProgramData\scoop\apps\python312\current\Lib\venv\scripts\nt\python.exe to C:\Users\adminuser\.tox\py\Scripts\python.exe [virtualenv\util\path\_sync.py:40] py: 1399 D copy C:\ProgramData\scoop\apps\python312\current\Lib\venv\scripts\nt\pythonw.exe to C:\Users\adminuser\.tox\py\Scripts\pythonw.exe [virtualenv\util\path\_sync.py:40] py: 1415 D create virtualenv import hook file C:\Users\adminuser\.tox\py\Lib\site-packages\_virtualenv.pth [virtualenv\create\via_global_ref\api.py:91] py: 1415 D create C:\Users\adminuser\.tox\py\Lib\site-packages\_virtualenv.py [virtualenv\create\via_global_ref\api.py:94] py: 1420 D ============================== target debug ============================== [virtualenv\run\session.py:52] py: 1420 D debug via 'C:\Users\adminuser\.tox\py\Scripts\python.exe' 'C:\ProgramData\scoop\apps\python312\current\Lib\site-packages\virtualenv\create\debug.py' [virtualenv\create\creator.py:200] py: 1420 D { "sys": { "executable": "C:\\Users\\adminuser\\.tox\\py\\Scripts\\python.exe", "_base_executable": "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7\\python.exe", "prefix": "C:\\Users\\adminuser\\.tox\\py", "base_prefix": "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7", "real_prefix": null, "exec_prefix": "C:\\Users\\adminuser\\.tox\\py", "base_exec_prefix": "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7", "path": [ "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7\\python312.zip", "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7\\DLLs", "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7\\Lib", "C:\\ProgramData\\scoop\\apps\\python312\\3.12.7", "C:\\Users\\adminuser\\.tox\\py", "C:\\Users\\adminuser\\.tox\\py\\Lib\\site-packages" ], "meta_path": [ "tox -rvv
Minimal example
No specific example. The LOCALAPPDATA environment variable has to be manually included via
pass_env
. If APPDATA is considered an automatically included variable on Windows, then LOCALAPPDATA should be included as well.