Skip to content

gh-117389: Fix test_compileall.EncodingTest #117390

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

Merged
merged 3 commits into from
May 5, 2024
Merged

Conversation

sobolevn
Copy link
Member

@sobolevn sobolevn commented Mar 30, 2024

Changes:

  • Removed coding, because we don't really need that anymore
  • Added () to print
  • Now simulating the core issue instead: bytes cannot contain unicode chars
  • Now checking the result of compile_dir call
  • Now checking the stdout to contain what we want

@vstinner can you please take a look? :)

@sobolevn sobolevn added skip news needs backport to 3.11 only security fixes needs backport to 3.12 only security fixes labels Mar 30, 2024
@bedevere-app bedevere-app bot added the tests Tests in the Lib/test dir label Mar 30, 2024
@sobolevn
Copy link
Member Author

sobolevn commented May 5, 2024

I've addressed all your points, @vstinner! Agree with all of them. Please, take another look when you will have time.

Copy link
Member

@vstinner vstinner left a comment

Choose a reason for hiding this comment

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

LGTM. You might remove UnicodeEncodeError test, or keep it. It's up to you.

'SyntaxError: bytes can only contain ASCII literal characters',
res,
)
self.assertNotIn('UnicodeEncodeError', res)
Copy link
Member

Choose a reason for hiding this comment

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

I don't think that this check is useful.

Copy link
Member Author

Choose a reason for hiding this comment

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

It was mentioned in #50965 (comment) so, I guess that it won't hurt.

@sobolevn sobolevn merged commit 44f6791 into python:main May 5, 2024
33 checks passed
@miss-islington-app
Copy link

Thanks @sobolevn for the PR 🌮🎉.. I'm working now to backport this PR to: 3.11, 3.12.
🐍🍒⛏🤖

miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 5, 2024
(cherry picked from commit 44f6791)

Co-authored-by: Nikita Sobolev <[email protected]>
miss-islington pushed a commit to miss-islington/cpython that referenced this pull request May 5, 2024
(cherry picked from commit 44f6791)

Co-authored-by: Nikita Sobolev <[email protected]>
@sobolevn
Copy link
Member Author

sobolevn commented May 5, 2024

backport to 3.11 is not needed anymore :(

@bedevere-app
Copy link

bedevere-app bot commented May 5, 2024

GH-118603 is a backport of this pull request to the 3.12 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.12 only security fixes label May 5, 2024
@bedevere-app
Copy link

bedevere-app bot commented May 5, 2024

GH-118604 is a backport of this pull request to the 3.11 branch.

@bedevere-app bedevere-app bot removed the needs backport to 3.11 only security fixes label May 5, 2024
sobolevn added a commit that referenced this pull request May 5, 2024
…8603)

gh-117389: Fix `test_compileall.EncodingTest` (GH-117390)
(cherry picked from commit 44f6791)

Co-authored-by: Nikita Sobolev <[email protected]>
SonicField pushed a commit to SonicField/cpython that referenced this pull request May 8, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
skip news tests Tests in the Lib/test dir
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants