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-63161: Add more tests for source encoding#139440

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

@serhiy-storchaka
Copy link
Member

@serhiy-storchakaserhiy-storchaka commentedSep 30, 2025
edited by bedevere-appbot
Loading

@vstinner
Copy link
Member

vstinner commentedSep 30, 2025
edited
Loading

Two tests are failing:

======================================================================FAIL: test_nul_in_first_coding_line (test.test_source_encoding.FileSourceEncodingTest.test_nul_in_first_coding_line)----------------------------------------------------------------------Traceback (most recent call last):  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_source_encoding.py", line 316, in test_nul_in_first_coding_line    self.check_script_error(src, br"source code (string )?cannot contain null bytes")    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_source_encoding.py", line 425, in check_script_error    self.assertRegex(res.err.rstrip().splitlines()[-1], b'SyntaxError: ' + expected)    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: Regex didn't match: b'SyntaxError: source code (string )?cannot contain null bytes' not found in b'\x1b[1;35mSyntaxError\x1b[0m: \x1b[35msource code cannot contain null bytes\x1b[0m'======================================================================FAIL: test_nul_in_second_coding_line (test.test_source_encoding.FileSourceEncodingTest.test_nul_in_second_coding_line)----------------------------------------------------------------------Traceback (most recent call last):  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_source_encoding.py", line 323, in test_nul_in_second_coding_line    self.check_script_error(src, br"source code (string )?cannot contain null bytes")    ~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^  File "/home/runner/work/cpython/cpython-ro-srcdir/Lib/test/test_source_encoding.py", line 425, in check_script_error    self.assertRegex(res.err.rstrip().splitlines()[-1], b'SyntaxError: ' + expected)    ~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^AssertionError: Regex didn't match: b'SyntaxError: source code (string )?cannot contain null bytes' not found in b'\x1b[1;35mSyntaxError\x1b[0m: \x1b[35msource code cannot contain null bytes\x1b[0m'

@serhiy-storchakaserhiy-storchaka merged commitb2f5ad0 intopython:mainSep 30, 2025
43 checks passed
@miss-islington-app
Copy link

Thanks@serhiy-storchaka for the PR 🌮🎉.. I'm working now to backport this PR to: 3.13, 3.14.
🐍🍒⛏🤖

@serhiy-storchakaserhiy-storchaka deleted the test_source_encoding2 branchSeptember 30, 2025 09:20
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 30, 2025
(cherry picked from commitb2f5ad0)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull requestSep 30, 2025
(cherry picked from commitb2f5ad0)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
@bedevere-app
Copy link

GH-139442 is a backport of this pull request to the3.14 branch.

@bedevere-appbedevere-appbot removed the needs backport to 3.14bugs and security fixes labelSep 30, 2025
@bedevere-app
Copy link

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

@bedevere-appbedevere-appbot removed the needs backport to 3.13bugs and security fixes labelSep 30, 2025
Yhg1s pushed a commit that referenced this pull requestOct 7, 2025
)(cherry picked from commitb2f5ad0)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
encukou pushed a commit that referenced this pull requestOct 7, 2025
…39442)(cherry picked from commitb2f5ad0)Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment

Reviewers

@pablogsalpablogsalAwaiting requested review from pablogsalpablogsal is a code owner

@lysnikolaoulysnikolaouAwaiting requested review from lysnikolaoulysnikolaou is a code owner

Assignees

No one assigned

Labels

skip newstestsTests in the Lib/test dir

Projects

None yet

Milestone

No milestone

Development

Successfully merging this pull request may close these issues.

2 participants

@serhiy-storchaka@vstinner

[8]ページ先頭

©2009-2025 Movatter.jp