This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author belopolsky
Recipients belopolsky, ezio.melotti, lemburg, vstinner
Date 2010-11-11.00:04:05
SpamBayes Score 4.106146e-07
Marked as misclassified No
Message-id <1289433958.33.0.737688451975.issue10382@psf.upfronthosting.co.za>
In-reply-to
Content
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)
History
Date User Action Args
2010-11-11 00:05:58belopolskysetrecipients: + belopolsky, lemburg, vstinner, ezio.melotti
2010-11-11 00:05:58belopolskysetmessageid: <1289433958.33.0.737688451975.issue10382@psf.upfronthosting.co.za>
2010-11-11 00:04:06belopolskylinkissue10382 messages
2010-11-11 00:04:06belopolskycreate