STINNER Victor <vstin...@python.org> added the comment:
> We could just forbid error handlers returning position not in the range > (start , end] Yeah, that sounds like a reasonable solution. I don't see the point of returning a position outside this range. What would be the use case? For me, the only corner case is the "ignore" error handler which returns an empty string, but it returns a position in this range, no? > it can break some code, so it is better to do this only in a new release. Implementing custom error handlers is a rare use case, so it should only affect a minority of users. Moreover, IMO returning a position outside the valid range is a bug. It's common that security fixes change the behavior, like rejecting values which were previously acceptd, to prevent a Python crash. ---------- _______________________________________ Python tracker <rep...@bugs.python.org> <https://bugs.python.org/issue36819> _______________________________________ _______________________________________________ Python-bugs-list mailing list Unsubscribe: https://mail.python.org/mailman/options/python-bugs-list/archive%40mail-archive.com