-
Notifications
You must be signed in to change notification settings - Fork 394
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
Reason behind pipx run forcing the subprocess' encoding to utf-8? #1423
Comments
Hmm yes, there is #335 (comment) and context. |
Thanks for the link @chrysle . Unfortunately to me the commit message doesn't make clear why this was added, and it doesn't seem related to the issue that it fixes. To make the whole thing a little more graspable:
prints
on my machine (Win10, cmd.exe in Windows Terminal,
in the same terminal prints everything correctly. And removing the above lines related to the subprocess encoding fixes this. |
As stated in #335 (comment), this was added to prevent any edge cases that might occur otherwise – normally, you're on the safe side with UTF-8 encoding, because it's that widespread. But I agree the behaviour you experience is unpleasant. Probably, we should make |
Hi. Today I stumbled upon a problem with
pipx run
, where the python tool to run prints German Umlauts like "ü". Those didn't show up correctly in the terminal, although I knew that they did when I ran the raw python scripts without pipx wrapped around.Turns out that the reason for this lies in pipx.util, where _fix_subprocess_env sets
into the environment inherited to the subprocess, and then exec_app sets
alongside to match that.
The problem is that my German Windows terminal (cmd.exe) is not UTF-8 but CP850, therefore anything coming as utf8 from Python looks like gibberish in my terminal.
I'd like to know if there was a specific reason behind forcing the encoding here,
or if anything speaks against just leaving these settings away so that Python can detect and use the encoding of the terminal, which works nicely in my case.
Thanks and cheers.
The text was updated successfully, but these errors were encountered: