UnicodeDecodeError: 'charmap' codec can't decode byte 0x9d in position 10442: character maps to <undefined>

Chris Angelico rosuav at gmail.com
Sat May 19 19:02:52 EDT 2018


On Sun, May 20, 2018 at 8:58 AM,  <bellcanadardp at gmail.com> wrote:
> On Thursday, 29 January 2009 12:09:29 UTC-5, Anjanesh Lekshminarayanan  wrote:
>> > It does auto-detect it as cp1252- look at the files in the traceback and
>> > you'll see lib\encodings\cp1252.py. Since cp1252 seems to be the wrong
>> > encoding, try opening it as utf-8 or latin1 and see if that fixes it.
>>
>> Thanks a lot ! utf-8 and latin1 were accepted !
>
> hello i am having same issue..i believe the code is written in python 2 and i am running python 3.6..i tried at the interpreter..f =
> open(filename, encoding="utf-8" and also latin-1..but then when i run my file i still get the error...also my line is at 7414..how do you find this line??...is it better to try to run the file .py in python 2??..thnxz

You're responding to something from 2009.

Your file is apparently not encoded the way you think it is. You'll
have to figure out what it ACTUALLY is.

ChrisA



More information about the Python-list mailing list