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

gh-120495: Fix incorrect exception handling in Tab Nanny#120498

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
hugovk merged 5 commits intopython:mainfromWulian233:tabnanny
Jun 15, 2024

Conversation

@Wulian233
Copy link
Contributor

@Wulian233Wulian233 commentedJun 14, 2024
edited
Loading

See issue, need backport to 3.13?

2024-06-14 195123

Wulian233and others added2 commitsJune 14, 2024 20:15
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@hugovkhugovk changed the titlegh-120495: Fix incorrect Exception Handling in tabnannygh-120495: Fix incorrect exception handling in Tab NannyJun 14, 2024
@hugovk
Copy link
Member

Please check the test failure:

======================================================================FAIL: test_with_errored_file (test.test_tabnanny.TestCommandLine.test_with_errored_file)Should displays error when errored python file is given.----------------------------------------------------------------------Traceback (most recent call last):  File "/Users/admin/actions-runner/_work/cpython/cpython/Lib/test/test_tabnanny.py", line 321, in test_with_errored_file    self.validate_cmd(file_path, stderr=stderr, expect_failure=True)    ~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/Users/admin/actions-runner/_work/cpython/cpython/Lib/test/test_tabnanny.py", line 313, in validate_cmd    self.assertListEqual(err.splitlines(), stderr.splitlines())    ~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: Lists differ: ["'/v[80 chars]py': Indentation Error: unindent does not matc[45 chars] 3)"] != ["'/v[80 chars]py': Token Error: unindent does not match any [39 chars] 3)"]First differing element 0:"'/va[79 chars]py': Indentation Error: unindent does not matc[44 chars]e 3)""'/va[79 chars]py': Token Error: unindent does not match any [38 chars]e 3)"  ["'/var/folders/4_/xyjwmyz[149](https://github.com/python/cpython/actions/runs/9515941863/job/26231269530?pr=120498#step:9:150)7g3qhhndg003800000gn/T/test_python_1c7vs70o/tmpubu1lray.py': "-  'Indentation Error: unindent does not match any outer indentation level '?   ^^^  ------+  'Token Error: unindent does not match any outer indentation level (<string>, '?   ^^^                                                              +++++++++++-  '(<string>, line 3)']+  'line 3)']
Wulian233 reacted with eyes emoji

@hugovk
Copy link
Member

Before, the indentation testtest_with_errored_file hit the first block:

exceptSyntaxErrorasmsg:errprint("%r: Token Error: %s"% (file,msg))return

But now, it's hitting the correct one:

exceptIndentationErrorasmsg:errprint("%r: Indentation Error: %s"% (file,msg))return

So we need to fix the test to look for the correct "Indentation Error" text.

Please could you update the test?

@Wulian233
Copy link
ContributorAuthor

@hugovk
Copy link
Member

That's right, change "Token Error" to "Indentation Error" :)

Copy link
Member

@hugovkhugovk left a comment

Choose a reason for hiding this comment

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

Thank you!

@hugovkhugovk added needs backport to 3.12only security fixes needs backport to 3.13bugs and security fixes labelsJun 15, 2024
@hugovkhugovkenabled auto-merge (squash)June 15, 2024 11:04
@hugovkhugovk merged commitc501261 intopython:mainJun 15, 2024
@miss-islington-app
Copy link

Thanks@Wulian233 for the PR, and@hugovk for merging it 🌮🎉.. I'm working now to backport this PR to: 3.12, 3.13.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 15, 2024
…nGH-120498)(cherry picked from commitc501261)Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestJun 15, 2024
…nGH-120498)(cherry picked from commitc501261)Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@bedevere-app
Copy link

GH-120548 is a backport of this pull request to the3.13 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelJun 15, 2024
@bedevere-app
Copy link

GH-120549 is a backport of this pull request to the3.12 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.12only security fixes labelJun 15, 2024
hugovk added a commit that referenced this pull requestJun 15, 2024
…20498) (#120549)gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498)(cherry picked from commitc501261)Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
hugovk added a commit that referenced this pull requestJun 15, 2024
…20498) (#120548)gh-120495: Fix incorrect exception handling in Tab Nanny (GH-120498)(cherry picked from commitc501261)Co-authored-by: Wulian233 <71213467+Wulian233@users.noreply.github.com>Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
@Wulian233Wulian233 deleted the tabnanny branchJune 19, 2024 10:16
mrahtz pushed a commit to mrahtz/cpython that referenced this pull requestJun 30, 2024
…n#120498)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
noahbkim pushed a commit to hudson-trading/cpython that referenced this pull requestJul 11, 2024
…n#120498)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
estyxx pushed a commit to estyxx/cpython that referenced this pull requestJul 17, 2024
…n#120498)Co-authored-by: Hugo van Kemenade <1324225+hugovk@users.noreply.github.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@aiskaiskaisk approved these changes

@hugovkhugovkhugovk approved these changes

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

@Wulian233@hugovk@aisk

[8]ページ先頭

©2009-2025 Movatter.jp