Open
Description
Issue
At this line:
The tool virtualenv
is launching pip
as a child process:
- It set the I/O encoding to
utf-8
- But
pip
may have a different opinion as the encoding is system dependent.
When pip
runs and there are some non-asci characters with his traces we may have failures leading to out
being set to None
.
Environment
Provide at least:
- OS: Windows 11 (possibly any version of Windows)
Just bare Python embed for Windows:
- https://www.python.org/ftp/python/3.12.6/python-3.12.6-embed-amd64.zip
- With pip installed from: https://bootstrap.pypa.io/get-pip.py
- Tool
pip
is at version24.2
Very very important to reproduce this issue:
- The user has a home folder with non-ASCII characters in the path.
- With another user with the home folder with only ASCII chars everything is fine.
The command which is failing:
{
"args": [
"C:/Development/gm-venv/bootstrap_3.12.6-1a8994a/python.exe",
"-m",
"virtualenv",
"C:/Development/gm-venv/venv_da29d03",
"--always-copy",
"--download",
"--prompt",
"venv_da29d03"
],
"cwd": "C:/Development/gm-venv",
"env": {
...
}
Note: by adding to the environment "PYTHONIOENCODING": "utf-8"
, the issue is worked around and everything is fine.
Output of the virtual environment creation
Make sure to run the creation with -vvv --with-traceback
:
fail
Traceback (most recent call last):
File "C:\Development\gm-venv\bootstrap_3.12.6-1a8994a\Lib\site-packages\virtualenv\seed\embed\via_app_data\via_app_data.py", line 84, in _get
result = get_wheel(
^^^^^^^^^^
File "C:\Development\gm-venv\bootstrap_3.12.6-1a8994a\Lib\site-packages\virtualenv\seed\wheels\acquire.py", line 36, in get_wheel
wheel = download_wheel(
^^^^^^^^^^^^^^^
File "C:\Development\gm-venv\bootstrap_3.12.6-1a8994a\Lib\site-packages\virtualenv\seed\wheels\acquire.py", line 77, in download_wheel
result = _find_downloaded_wheel(distribution, version_spec, for_py_version, to_folder, out)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "C:\Development\gm-venv\bootstrap_3.12.6-1a8994a\Lib\site-packages\virtualenv\seed\wheels\acquire.py", line 83, in _find_downloaded_wheel
for line in out.splitlines():
^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'splitlines'