Skip to content

Commit 3ba5e25

Browse files
Revert "bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)" (GH-10403)
This reverts commit c64583b due to multiple buildbot failures when building it. (cherry picked from commit 6843ffe) Co-authored-by: Pablo Galindo <[email protected]>
1 parent b097f9f commit 3ba5e25

File tree

2 files changed

+6
-7
lines changed

2 files changed

+6
-7
lines changed

Lib/venv/scripts/nt/activate.bat

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
11
@echo off
22

3-
rem This file is UTF-8 encoded, so we need to update the current code page while executing it.
4-
for /f %%a in ('%~dp0python.exe -Ic "import ctypes; print(ctypes.windll.kernel32.GetConsoleOutputCP())"') do (set "_OLD_CODEPAGE=%%a")
5-
3+
rem This file is UTF-8 encoded, so we need to update the current code page while executing it
4+
for /f "tokens=2 delims=:" %%a in ('"%SystemRoot%\System32\chcp.com"') do (
5+
set "_OLD_CODEPAGE=%%a"
6+
)
67
if defined _OLD_CODEPAGE (
7-
%~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(65001)"
8+
"%SystemRoot%\System32\chcp.com" 65001 > nul
89
)
910

1011
set "VIRTUAL_ENV=__VENV_DIR__"
@@ -39,6 +40,6 @@ set "PATH=%VIRTUAL_ENV%\__VENV_BIN_NAME__;%PATH%"
3940

4041
:END
4142
if defined _OLD_CODEPAGE (
42-
%~dp0python.exe -Ic "import ctypes; ctypes.windll.kernel32.SetConsoleOutputCP(%_OLD_CODEPAGE%)"
43+
"%SystemRoot%\System32\chcp.com" %_OLD_CODEPAGE% > nul
4344
set "_OLD_CODEPAGE="
4445
)

Misc/NEWS.d/next/Library/2018-11-02-12-01-00.bpo-32409.MFRX2Q.rst

Lines changed: 0 additions & 2 deletions
This file was deleted.

0 commit comments

Comments
 (0)