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 <>
Looking at the specs in PEP 293 (, 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.
Date User Action Args
2021-09-29 08:23:46lemburgsetrecipients: + lemburg, vstinner, serhiy.storchaka, anthonypjshaw, atalaba, iritkatriel
2021-09-29 08:23:45lemburgsetmessageid: <>
2021-09-29 08:23:45lemburglinkissue36819 messages
2021-09-29 08:23:45lemburgcreate