Skip to content

[3.7] bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)#10377

Merged
vsajip merged 1 commit intopython:3.7from
miss-islington:backport-c64583b-3.7
Nov 7, 2018
Merged

[3.7] bpo-32409: Fix regression in activate.bat on international Windows (GH-10295)#10377
vsajip merged 1 commit intopython:3.7from
miss-islington:backport-c64583b-3.7

Conversation

@miss-islington
Copy link
Copy Markdown
Contributor

@miss-islington miss-islington commented Nov 7, 2018

Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.

We can't use VENV_PYTHON to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
(cherry picked from commit c64583b)

Co-authored-by: samstagern 30337691+samstagern@users.noreply.github.com

https://bugs.python.org/issue32409

…ythonGH-10295)

Handle Unicode contents on localised Windows systems when activating a
venv. activate.bat currently breaks on German Windows systems, as chcp.com does
not return a plain number as on English systems, but (arbitrarily) appends a dot at the end
(for example "Aktive Codepage: 850." instead of "Active Codepage: 850"). The
dependency to chcp.com is removed and ctypes is used to get, set and restore the
console output code page. The code page for console input is not changed.

We can't use __VENV_PYTHON__ to find python.exe, since it's UTF-8. cmd.exe decodes
the script using the console output code page.
(cherry picked from commit c64583b)

Co-authored-by: samstagern <30337691+samstagern@users.noreply.github.com>
@miss-islington
Copy link
Copy Markdown
Contributor Author

@samstagern and @vsajip: Status check is done, and it's a success ✅ .

@vsajip vsajip merged commit 881e273 into python:3.7 Nov 7, 2018
@miss-islington miss-islington deleted the backport-c64583b-3.7 branch November 7, 2018 19:26
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants