Closed Laiteux closed 1 year ago
Is that the answer to this issue as well? https://github.com/Tyrrrz/CliWrap/issues/63#issuecomment-626374243
Well, I tried the chcp
wrapping workaround (https://github.com/Tyrrrz/CliWrap/issues/196#issuecomment-1445190176) which didn't help.
Got it to work by adding PYTHONIOENCODING
:UTF-8
to environment variables.
Not sure if I should leave this open.
Got it to work by adding
PYTHONIOENCODING
:UTF-8
to environment variables.Not sure if I should leave this open.
My guess is that the program can't infer the correct encoding (because there is no terminal), so it falls back to cp1252
, while also at the same time trying to produce Unicode characters to the console. I suspect you could also work around this by wrapping an actual terminal (i.e. cmd
) and running the program through there.
I'd say it's an error on their end, at least based on what you've described. So I'm going to close the issue. Hopefully, your findings (the environment variable) may also be useful to someone in the future.
Version
3.6.4
Platform
.NET 7 / Windows 11
Steps to reproduce
Install https://github.com/jsavargas/zspotify (I used
pip
, not sure if using Docker would make a difference)Then run this code:
Which will throw:
Details
The unicode header ("splash screen") they're printing seems to be the issue: https://github.com/jsavargas/zspotify/blob/master/zspotify/__main__.py#L263
I have tried setting different output encodings but without success.
Checklist