Skip to content

bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr#25075

Merged
pablogsal merged 3 commits into
python:masterfrom
pablogsal:bpo-43660
Mar 29, 2021
Merged

bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr#25075
pablogsal merged 3 commits into
python:masterfrom
pablogsal:bpo-43660

Conversation

@pablogsal

@pablogsal pablogsal commented Mar 29, 2021

Copy link
Copy Markdown
Member

Comment thread Lib/test/test_sys.py Outdated
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
Comment thread Lib/test/test_sys.py Outdated
# If the default displayhook doesn't take a strong reference
# to sys.stderr the following code can crash. See bpo-43660
# for more details.
code = """

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Could you please use textwrap.dedent() for that?

Copy link
Copy Markdown
Member Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Will do

@vstinner vstinner left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM, but I added a minor remark on the test ;-)

Comment thread Lib/test/test_sys.py Outdated

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

thanks to dedent(), it can be removed ;-)

@miss-islington

Copy link
Copy Markdown
Contributor

Thanks @pablogsal for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8, 3.9.
🐍🍒⛏🤖

@pablogsal pablogsal deleted the bpo-43660 branch March 29, 2021 22:38
@bedevere-bot

Copy link
Copy Markdown

GH-25083 is a backport of this pull request to the 3.9 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 29, 2021
…r sys.stderr (pythonGH-25075)

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-25084 is a backport of this pull request to the 3.8 branch.

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request Mar 29, 2021
…r sys.stderr (pythonGH-25075)

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@miss-islington

Copy link
Copy Markdown
Contributor

Sorry, @pablogsal, I could not cleanly backport this to 3.7 due to a conflict.
Please backport using cherry_picker on command line.
cherry_picker 09b90a037d18f5d4acdf1b14082e57bda78e85d3 3.7

miss-islington added a commit that referenced this pull request Mar 29, 2021
…r sys.stderr (GH-25075)

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
pablogsal added a commit to pablogsal/cpython that referenced this pull request Mar 29, 2021
…ues for sys.stderr (pythonGH-25075).

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
@bedevere-bot

Copy link
Copy Markdown

GH-25085 is a backport of this pull request to the 3.7 branch.

pablogsal added a commit that referenced this pull request Mar 29, 2021
…ues for sys.stderr (GH-25075). (GH-25085)

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
pablogsal added a commit that referenced this pull request Mar 29, 2021
…r sys.stderr (GH-25075) (GH-25083)

(cherry picked from commit 09b90a0)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants