Alexander Belopolsky <[email protected]> added the comment:
I am attaching a patch that seems to fix the issue. Note that I considered
fixing the problem in parsetok.c where offset is originally computed, but this
is part of pgen which has to be compiled without unicode support.
The test case suitable to be included in unittests is:
try:
eval(b'\xc2\xa1'.decode('utf-8'))
except SyntaxError as err:
assert(err.offset == 1)
----------
assignee: -> belopolsky
keywords: +patch
stage: needs patch -> patch review
Added file: http://bugs.python.org/file19565/issue10382.diff
_______________________________________
Python tracker <[email protected]>
<http://bugs.python.org/issue10382>
_______________________________________
_______________________________________________
Python-bugs-list mailing list
Unsubscribe:
http://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com