-
Notifications
You must be signed in to change notification settings - Fork 3k
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
pip fails without error message on a particular package when chcp 65001 (UTF-8) is set on Windows 7 RUS #5878
Comments
UPD
This whole bug is rather strange... Output of
|
I guess this means that pip (and twine) UTF-8 support on Windows is buggy. By the way: twine also doesn't work with |
Does pip work if you supply |
Today I wanted to test the issue with |
@mareknino95 do you still have an issue? |
After the error dissappeared from Windows 7 RUS it re-appeared on Windows 7 ENG. |
On Windows 7 ENG: after UPD: Then re-appeared the next day... It's rather dejecting bug... |
@uranusjr I confirm that |
@uranusjr I confirm that |
@uranusjr But if non-unicode progress bar is at fault why the bug happen in console switched to UTF-8 and doesn't appear in default ASCII console? |
This is most definitely the same issue then. The progress bar contains non-ASCII characters, and causes decoding error if the console uses certain code pages. #5671 makes the progress bar fully ASCII-compatible, and should fix this problem. |
That is a good question, and I don’t know the answer :( Windows code pages are known to be difficult to handle. It could be some problem caused by interfacing of Python IO and Windows API, I am not extremely knowledgable about Windows console encoding, only know that mysterious things happen all the time when you try to feed non-ASCII things to it. |
I guess the simple solution of using |
I've hesitated to say this, as I don't have any direct evidence, but my understanding is that In my experience, other codepages behave well enough - most Unicode problems on Windows (outside of |
But |
No, there is no other way to have UTF-8 in a Windows console. 65001 is also special in the sense that it is the only variable-length encoding supported by Windows, and my understanding (not very well!) is that the Windows API has some weird cases regarding this, since it is not designed with it in mind. This is drifting off topic, but I think your best bet would be to avoid console piping altogether. It is much more reliable to output to a (temporary) file, and read it into another process. |
Yeah... Thanks all for new information! |
Well, the console is natively Unicode, and under Python 3.7 (and 3.6, IIRC) Python can print Unicode direct to sys.stdout without needing any codepage games. But (a) that doesn't help with older versions of Python, and (b) the progress bar library may well not take advantage of this (again, because it needs to support older versions). As usual, backward compatibility is the real issue here - if we could ditch anything other than Windows 10 and Python 3.7+, the code we'd need would be a lot cleaner and less error prone :-) |
#5671 fixed this. |
Environment
Description
pip fails without error message on a particular package when
chcp 65001
(UTF-8) is set on Windows 7 RUSBug happens when using pip in Anaconda on Windows 7 RUS with
chcp 65001
set (UTF-8) - when I try to installpip install pandoctools
(but everything is OK whenchcp 65001
is not set though).After
pip install pandoctools
pip downloads the package then exits without any message and changes color of the console text.Interesting that on Windows 7 x64 ENG I didn't have such behaviour: I got some Unicode error that dissappeared when I updated python from 3.6.5 to 3.6.6. But updating python didn't help on Windows 7 x64 RUS.
How to Reproduce
chcp 65001
in terminalpip install pandoctools
No output. Only font changing.
The text was updated successfully, but these errors were encountered: