-
-
Notifications
You must be signed in to change notification settings - Fork 31.9k
Incorrect handling of start
and end
values in codecs
error handlers
#126004
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Comments
start
and end
values in codecs.xmlcharrefreplace_errors
handlerstart
and end
values in codecs
error handlers
FTR: I prepared three branches that fix (and cleanup) the error handlers. Those branches include #123380 and thus I'll wait for the latter to be merged since otherwise there will be a crash even before the actual "bad" code happens. The fixes are actually quite straightforward: there is actually no check on the consistency of cc @encukou |
Since #123378 is only 3.14+ (not backported), the fixes for those handlers will also be 3.14+ only. |
#127675) This fixes how `PyCodec_XMLCharRefReplaceErrors` handles the `start` and `end` attributes of `UnicodeError` objects via the `_PyUnicodeError_GetParams` helper.
This fixes how `PyCodec_ReplaceErrors` handles the `start` and `end` attributes of `UnicodeError` objects via the `_PyUnicodeError_GetParams` helper.
…#127676) This fixes how `PyCodec_BackslashReplaceErrors` handles the `start` and `end` attributes of `UnicodeError` objects via the `_PyUnicodeError_GetParams` helper.
Crash report
What happened?
See #123378 for the root cause. Since we are still wondering how to fix the getters and setters, I suggest we first fix the crash by adding the checks inside at the handler's level (for now). I'm not sure if the handler itself is handling corner cases correctly as well.
Linked PRs
codecs.replace_errors
#127674codecs.xmlcharrefreplace_errors
#127675codecs.backslashreplace_errors
#127676The text was updated successfully, but these errors were encountered: