Amaury Forgeot d'Arc <amaur...@gmail.com> added the comment: Issue4742 is similar issue:
>>> source = b"# coding=cp1252\n\x94 = '\x94'".decode('cp1252') >>> compile(source, '<test>', 'exec') Traceback (most recent call last): File "<stdin>", line 1, in <module> File "<test>", line 0 SyntaxError: unknown encoding: cp1252 The real error here is masked; just before the exception is set, there is a pending SyntaxError: 'charmap' codec can't decode byte 0x9d in position 18: character maps to <undefined> It seems that the source internal representation is correct utf-8, but this is decoded again with the "coding=" cookie. ---------- nosy: +amaury.forgeotdarc _______________________________________ Python tracker <rep...@bugs.python.org> <http://bugs.python.org/issue4626> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com