Message78535
This is a duplicate of issue4626.
Here, the content is correctly decoded with cp1252, then passed to
compile(); but compile() works on the internal utf-8 representation, and
tries to decode it again with cp1252!
Yes, the error message is overwritten. If I remove the code that sets
the "unknown encoding" exception, I get:
>>> compile(open("c:/temp/t1252.py", encoding="cp1252").read(),
"t1252.py", "exec")
SyntaxError: 'charmap' codec can't decode byte 0x9d in position 35:
character maps to <undefined>
The 0x9d explains easily:
>>> b"\x94".decode('cp1252').encode('utf8')
b'\xe2\x80\x9d' |
|
Date |
User |
Action |
Args |
2008-12-30 14:38:03 | amaury.forgeotdarc | set | recipients:
+ amaury.forgeotdarc, lemburg, sjmachin, tarek |
2008-12-30 14:38:03 | amaury.forgeotdarc | set | messageid: <1230647883.5.0.881475748077.issue4742@psf.upfronthosting.co.za> |
2008-12-30 14:37:58 | amaury.forgeotdarc | link | issue4742 messages |
2008-12-30 14:37:58 | amaury.forgeotdarc | create | |
|