Message402830
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. |
|
Date |
User |
Action |
Args |
2021-09-29 08:23:46 | lemburg | set | recipients:
+ lemburg, vstinner, serhiy.storchaka, anthonypjshaw, atalaba, iritkatriel |
2021-09-29 08:23:45 | lemburg | set | messageid: <1632903825.77.0.226091931508.issue36819@roundup.psfhosted.org> |
2021-09-29 08:23:45 | lemburg | link | issue36819 messages |
2021-09-29 08:23:45 | lemburg | create | |
|