diff --git a/.github/workflows/check.yaml b/.github/workflows/check.yaml index 68120bde6..c6e6ba93b 100644 --- a/.github/workflows/check.yaml +++ b/.github/workflows/check.yaml @@ -55,6 +55,10 @@ jobs: uses: actions/checkout@v4 with: fetch-depth: 0 + - name: 🏷️ Fetch upstream tags for versioning + shell: bash + run: | + git fetch --force --tags https://github.com/pypa/virtualenv.git - name: 🐍 Setup Python for tox uses: actions/setup-python@v5 with: @@ -63,9 +67,9 @@ jobs: shell: bash run: | if [[ "${{ matrix.py }}" == "3.13t" || "${{ matrix.py }}" == "3.14t" ]]; then - uv tool install --no-managed-python --python 3.14 tox --with . + uv tool install --no-managed-python --python 3.14 "tox>=4.32" --with . else - uv tool install --no-managed-python --python 3.14 tox --with tox-uv --with . + uv tool install --no-managed-python --python 3.14 "tox>=4.32" --with tox-uv --with . fi - name: 🐍 Setup Python for test ${{ matrix.py }} uses: actions/setup-python@v5 @@ -109,7 +113,7 @@ jobs: run: tox run -vvvv --notest --skip-missing-interpreters false - name: 🏃 Run test suite run: tox run --skip-pkg-install - timeout-minutes: 20 + timeout-minutes: 30 env: PYTEST_ADDOPTS: "-vv --durations=20" CI_RUN: "yes" @@ -137,11 +141,15 @@ jobs: - name: 🚀 Install uv uses: astral-sh/setup-uv@v4 - name: 📦 Install tox - run: uv tool install --python-preference only-managed --python 3.14 tox --with tox-uv + run: uv tool install --python-preference only-managed --python 3.14 "tox>=4.32" --with tox-uv - name: 📥 Checkout code uses: actions/checkout@v4 with: fetch-depth: 0 + - name: 🏷️ Fetch upstream tags for versioning + shell: bash + run: | + git fetch --force --tags https://github.com/pypa/virtualenv.git - name: 🏗️ Setup check suite run: tox run -vv --notest --skip-missing-interpreters false -e ${{ matrix.tox_env }} - name: 🏃 Run check for ${{ matrix.tox_env }} diff --git a/src/virtualenv/discovery/cached_py_info.py b/src/virtualenv/discovery/cached_py_info.py index ee2034615..26e54a8da 100644 --- a/src/virtualenv/discovery/cached_py_info.py +++ b/src/virtualenv/discovery/cached_py_info.py @@ -125,6 +125,9 @@ def _run_subprocess(cls, exe, app_data, env): # prevent sys.prefix from leaking into the child process - see https://bugs.python.org/issue22490 env = env.copy() env.pop("__PYVENV_LAUNCHER__", None) + # Force UTF-8 mode to handle output from Microsoft Store Python stub on Windows + # See https://github.com/pypa/virtualenv/issues/2812 + env["PYTHONUTF8"] = "1" LOGGER.debug("get interpreter info via cmd: %s", LogCmd(cmd)) try: process = Popen( @@ -135,6 +138,7 @@ def _run_subprocess(cls, exe, app_data, env): stdout=subprocess.PIPE, env=env, encoding="utf-8", + errors="backslashreplace", ) out, err = process.communicate() code = process.returncode