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
bpo-43660: Fix crash when displaying exceptions with custom values for sys.stderr #25075
Conversation
Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no>
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 = """ |
There was a problem hiding this comment.
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?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Will do
Lib/test/test_sys.py
Outdated
# to sys.stderr the following code can crash. See bpo-43660 | ||
# for more details. | ||
code = textwrap.dedent(''' | ||
if True: |
There was a problem hiding this comment.
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 ;-)
Thanks @pablogsal for the PR |
GH-25083 is a backport of this pull request to the 3.9 branch. |
…r sys.stderr (pythonGH-25075) (cherry picked from commit 09b90a0) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
GH-25084 is a backport of this pull request to the 3.8 branch. |
…r sys.stderr (pythonGH-25075) (cherry picked from commit 09b90a0) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Sorry, @pablogsal, I could not cleanly backport this to |
…ues for sys.stderr (pythonGH-25075). (cherry picked from commit 09b90a0) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
GH-25085 is a backport of this pull request to the 3.7 branch. |
…
https://bugs.python.org/issue43660