Uh oh!
There was an error while loading. Please reload this page.
bpo-37467: Fix PyErr_Display() for bytes filename - #14504
Merged
Conversation
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string.
vstinner
commented
Jul 1, 2019
MemberAuthor
The test fails on the CI, but it pass locally on my Linux laptop and in my Windows VM. I don't understand why. Example of failure on AppVeyor: |
* Sort imports * Rename numruns global var to INTERN_NUMRUNS * Add DisplayHookTest and ExceptHookTest test case classes * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method * Test error case (call hook with no argument) after the success case
miss-islington
commented
Jul 1, 2019
Contributor
Thanks @vstinner for the PR 🌮🎉.. I'm working now to backport this PR to: 3.7, 3.8. |
bedevere-bot
commented
Jul 1, 2019
GH-14514 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
Jul 1, 2019
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case. (cherry picked from commit f9b7457) Co-authored-by: Victor Stinner <vstinner@redhat.com>
miss-islington
commented
Jul 1, 2019
Contributor
Sorry, @vstinner, I could not cleanly backport this to |
bedevere-bot
commented
Jul 1, 2019
GH-14515 is a backport of this pull request to the 3.7 branch. |
miss-islington added a commit
that referenced
this pull request
Jul 1, 2019
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case. (cherry picked from commit f9b7457) Co-authored-by: Victor Stinner <vstinner@redhat.com>
vstinner added a commit
that referenced
this pull request
Jul 1, 2019
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case. (cherry picked from commit f9b7457)
lisroach pushed a commit
to lisroach/cpython
that referenced
this pull request
Sep 10, 2019
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case.
DinoV pushed a commit
to DinoV/cpython
that referenced
this pull request
Jan 14, 2020
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes string. For example, for a SyntaxError exception where the filename attribute is a bytes string. Cleanup also test_sys: * Sort imports. * Rename numruns global var to INTERN_NUMRUNS. * Add DisplayHookTest and ExceptHookTest test case classes. * Don't save/restore sys.stdout and sys.displayhook using setUp()/tearDown(): do it in each test method. * Test error case (call hook with no argument) after the success case.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for freeto join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Fix sys.excepthook() and PyErr_Display() if a filename is a bytes
string. For example, for a SyntaxError exception where the filename
attribute is a bytes string.
https://bugs.python.org/issue37467