Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Merged
merged 1 commit into from Nov 7, 2018

Conversation

@miss-islington
Copy link

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

…H-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

This comment has been minimized.

Copy link
Author

miss-islington commented Nov 7, 2018

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

@vsajip vsajip merged commit 881e273 into python:3.7 Nov 7, 2018
6 checks passed
6 checks passed
Azure Pipelines PR #20181107.7 succeeded
Details
bedevere/issue-number Issue number 32409 found
Details
bedevere/maintenance-branch-pr Valid maintenance branch PR title.
bedevere/news News entry found in Misc/NEWS.d
continuous-integration/appveyor/pr AppVeyor build succeeded
Details
continuous-integration/travis-ci/pr The Travis CI build passed
Details
@miss-islington miss-islington deleted the miss-islington:backport-c64583b-3.7 branch Nov 7, 2018
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
5 participants
You can’t perform that action at this time.