Movatterモバイル変換


[0]ホーム

URL:


Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

[3.11] gh-111942: Fix crashes in TextIOWrapper.reconfigure() (GH-111976)#112059

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 ourterms of service andprivacy statement. We’ll occasionally send you account related emails.

Already on GitHub?Sign in to your account

Merged

Conversation

miss-islington
Copy link
Contributor

@miss-islingtonmiss-islington commentedNov 14, 2023
edited by bedevere-appbot
Loading

  • Fix crash when encoding is not string or None.
  • Fix crash when both line_buffering and write_through raise exception
    when converted ti int.
  • Add a number of tests for constructor and reconfigure() method
    with invalid arguments.
    (cherry picked from commitee06fff)

Co-authored-by: Serhiy Storchakastorchaka@gmail.com

…-111976)* Fix crash when encoding is not string or None.* Fix crash when both line_buffering and write_through raise exception  when converted ti int.* Add a number of tests for constructor and reconfigure() method  with invalid arguments.(cherry picked from commitee06fff)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@vstinner
Copy link
Member

test_io failed on Address Sanitizer job:

ERROR: test_constructor (test.test_io.CTextIOWrapperTest.test_constructor)----------------------------------------------------------------------UnicodeEncodeError: 'utf-8' codec can't encode character '\udcfe' in position 0: surrogates not allowedThe above exception was the direct cause of the following exception:Traceback (most recent call last):  File "/home/runner/work/cpython/cpython/Lib/test/test_io.py", line 2631, in test_constructor    t.__init__(b, encoding="utf-8", errors='\udcfe')SystemError: <method 'readable' of '_io.BytesIO' objects> returned a result with an exception set

This PR should be backport to 3.11 with its fix. I will wait until#112089 is merged into 3.12.

…tor (pythonGH-112061) (pythonGH-112089)In non-debug more the check for the "errors" argument is skipped,and then PyUnicode_AsUTF8() can fail, but its result was not checked.Co-authored-by: Victor Stinner <vstinner@python.org>(cherry picked from commit9302f05)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@serhiy-storchakaserhiy-storchaka merged commite2421a3 intopython:3.11Nov 15, 2023
@JelleZijlstraJelleZijlstra mentioned this pull requestApr 22, 2024
3 tasks
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@miss-islington@vstinner@serhiy-storchaka

[8]ページ先頭

©2009-2025 Movatter.jp