Skip to content

Conversation

@moltob
Copy link

@moltob moltob commented Nov 25, 2018

The current version of the Windows activate.bat activation script unfortunately does not work well in some international versions of Windows.

E.g. on a German Windows 10 version (or the bug reporter's Swiss version) the output of chcp is something like this:

Aktive Codepage: 850.

Unlike the US version, the statement ends with a period, unexpected by the activation script, leading to an unsuccessful attempt to reset the codepage after venv installation. While the venv is set up correctly, the codepage is not reset. In addition a user-visible error message appears, confusing users and giving the doubt whether venv actually worked:

Parameterformat falsch - 850.

(English: "wrong parameter format")

The fix leaves the original approach in place, but deletes any periods from the CP number string, if they exist, which means it simply cleans up the CP string. This should have minimal side effects.

https://bugs.python.org/issue35148

@the-knights-who-say-ni

This comment has been minimized.

@moltob moltob changed the title bpo-35148: fix parsing chcp output bpo-35148: fix parsing chcp output in activate.bat Nov 25, 2018
@moltob moltob changed the title bpo-35148: fix parsing chcp output in activate.bat bpo-35148: fix resetting codepage in activate.bat Nov 25, 2018
@moltob
Copy link
Author

moltob commented Nov 26, 2018

@eryksun Thanks for the link. However, I have the feeling that critique about robustness might apply to the original implementation as well.

PS: I did sign the CLA yesterday... How long does that usually take to become visible at https://check-python-cla.herokuapp.com/?

This leaves the original approach untouched and simply removes a period, if it is an unwanted part of the CP string.
@moltob
Copy link
Author

moltob commented Nov 26, 2018

@eryksun Please review the new approach, which should have even less side effects.

@moltob
Copy link
Author

moltob commented Jan 26, 2019

Dear reviewers, this is another attempt to draw anybody's attention to this fix. For non-US Windows versions like German and Swiss the linked bug is quite annoying and confusing users. If at all possible could anybody review this trivial patch?

I s/o knows what I can do to bring just a little bit of attention to this patch to get it merged, please let me know.

@ned-deily ned-deily requested a review from vsajip January 31, 2019 16:18
@Acconut
Copy link

Acconut commented May 3, 2019

@moltob Thank you very much for providing this patch. It helped me to resolve this exact problem on my german Windows 7 machine.

@moltob
Copy link
Author

moltob commented May 3, 2019

@Acconut You're welcome.

It's sad, that there does not seem to be a way to raise this annoyance for non-US users to the mainly US-based core developer group. I gave up on re-requesting a review. 😞 Might be related to many developers not using Windows either...

If anybody has a suggestion, please let me know.

Just double-checked with 3.7.3. Ugh...

d:\Temp
λ py -V
Python 3.7.3

d:\Temp
λ py -m venv venv

d:\Temp
λ venv\Scripts\activate.bat
Parameterformat falsch - 850.

@eryksun
Copy link
Contributor

eryksun commented May 3, 2019

This issue is resolved (#8321). Sorry it was handled badly. In addition to the accepted PR and this PR, there was also #10295. The latter was merged but subsequently reverted because it relied on the virtual environment having a "python.exe" executable, but sometimes we only have the debug build, "python_d.exe". Maybe Vinay was waiting for that problem to be addressed.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

5 participants