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 lemburg
Recipients anthonypjshaw, atalaba, iritkatriel, lemburg, serhiy.storchaka, vstinner
Date 2021-09-29.08:23:45
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1632903825.77.0.226091931508.issue36819@roundup.psfhosted.org>
In-reply-to
Content
Looking at the specs in PEP 293 (https://www.python.org/dev/peps/pep-0293/), it is certainly possible for the error handler to return a newpos outside the range start - end, meaning in most cases: a value >= end.

There's a good reason for this: the codec may not be able to correctly determine the end of the sequence and so the end value presented by the codec is not necessarily a valid start to continue encoding/decoding. The error handler can e.g. choose to skip more input characters by trying to find the next valid sequence.

In the example script, the handler returns start, so the value is within the range. A limit would not solve the problem.

It seems that the reallocation logic of the codecs is the main problem here.
History
Date User Action Args
2021-09-29 08:23:46lemburgsetrecipients: + lemburg, vstinner, serhiy.storchaka, anthonypjshaw, atalaba, iritkatriel
2021-09-29 08:23:45lemburgsetmessageid: <1632903825.77.0.226091931508.issue36819@roundup.psfhosted.org>
2021-09-29 08:23:45lemburglinkissue36819 messages
2021-09-29 08:23:45lemburgcreate