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

bpo-35148: fix resetting codepage in activate.bat #10696

Closed
wants to merge 4 commits into from

Conversation

@moltob
Copy link

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 was marked as resolved.

Copy link

commented Nov 25, 2018

Hello, and thanks for your contribution!

I'm a bot set up to make sure that the project can legally accept your contribution by verifying you have signed the PSF contributor agreement (CLA).

Unfortunately we couldn't find an account corresponding to your GitHub username on bugs.python.org (b.p.o) to verify you have signed the CLA (this might be simply due to a missing "GitHub Name" entry in your b.p.o account settings). This is necessary for legal reasons before we can look at your contribution. Please follow the steps outlined in the CPython devguide to rectify this issue.

You can check yourself to see if the CLA has been received.

Thanks again for your contribution, we look forward to reviewing it!

@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

This comment has been minimized.

Copy link
Author

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/?

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

This comment has been minimized.

Copy link
Author

commented Nov 26, 2018

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

@moltob

This comment has been minimized.

Copy link
Author

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 Jan 31, 2019

@Acconut

This comment has been minimized.

Copy link

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

This comment has been minimized.

Copy link
Author

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

This comment has been minimized.

Copy link
Contributor

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
5 participants
You can’t perform that action at this time.