Beta release of pip version 10

MRAB python at mrabarnett.plus.com
Sun Apr 1 14:04:30 EDT 2018


On 2018-04-01 11:26, Paul Moore wrote:
> On 1 April 2018 at 04:15, Mikhail V <mikhailwas at gmail.com> wrote:
>> MRAB writes:
>>
>>
>>> > UnicodeEncodeError: 'charmap' codec can't encode character
>>> >
>>> > when it meets a non-ascii char.
>>> >
>>> > e.g. tried this:
>>> > pip search pygame > a.txt
>>> >
>>> Well, _I_ didn't get an error!
>>>
>>> One of the lines is:
>>>
>>> kundalini (0.4)                - LրVE-like PyGame API
>>>
>>> So it's down to what system encoding (active code page) is in use.
>>
>> Dunno, it gives me error regardless of active codepage,
>> my default is 866, i've set to 1252 or 65001, same error.
>>
>> The output itself is fine - I see correct glyphs, so the error
>> only appears when I redirect to file.
>> if I try some python script e.g. "a.py":
>> print ("абв")
>>
>> and run:
>> py a.py > a.txt
>>
>> I get some gibberish in the file.
>> So it is probably a global issue. Nothing works in this life :)
> 
> That actually sounds more like a redirection issue. Redirecting in the
> cmd shell uses the OEM codepage, I believe, and Python outputs to a
> pipe using the ANSI codepage, IIRC (I'd have to check to be certain).
> 
Yep, it's fine until redirected.


More information about the Python-list mailing list