-
-
Notifications
You must be signed in to change notification settings - Fork 29.2k
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
Crash in str.decode() with special error handler #67510
Comments
Debugging build crashes in some circumstances in str.decode() with error handler which produces replacement string with length larger than malformed data. For example the backslashreplace error handler produces 4-character string for every illegal byte. All other standard error handlers produce no longer than 1 character for every illegal unit. Here is a patch which fixes this issue. I'll commit it without review because buildbots are broken without it. This issue is open for reference and post-commit review. |
New changeset 2de90090e486 by Serhiy Storchaka in branch '3.4': New changeset 1cd68b3c46aa by Serhiy Storchaka in branch 'default': |
Is it a regression? Would it be possible to identify the changeset |
I think the changeset which made decoders to use _PyUnicodeWriter (bpo-16311) For example consider b'\x80abc'.decode('utf-8', 'backslashreplace'). The writer reserves string buffer with size 4 (every byte produces at most 1 |
New changeset 1e8937861ee3 by Victor Stinner in branch 'default': |
If you have no enhancements to my quick fix Victor, may be this issue can be closed. |
I closed the issue. |
Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.
Show more details
GitHub fields:
bugs.python.org fields:
The text was updated successfully, but these errors were encountered: