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-128520: pathlib ABCs: raise text encoding warnings at correct stack level#133051

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
barneygale merged 2 commits intopython:mainfrombarneygale:abc-encoding-warnings
Apr 28, 2025

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedApr 27, 2025
edited by bedevere-appbot
Loading

Ensure that warnings about unspecified text encodings are emitted fromReadablePath.read_text(),WritablePath.write_text() andmagic_open() with the correct stack level set.

These classes/functions are still private, so there's no public change of behaviour.

Ensure that warnings about unspecified text encodings are emitted from`ReadablePath.read_text()`, `WritablePath.write_text()` and `magic_open()`with the correct stack level set.
Copy link
Member

@JelleZijlstraJelleZijlstra left a comment

Choose a reason for hiding this comment

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

Looks good. Do we run any tests/buildbots withwarn_default_encoding on?

An alternative way to write the tests would be to run a subprocess that has the flag on.

barneygale reacted with thumbs up emoji
@barneygale
Copy link
ContributorAuthor

barneygale commentedApr 28, 2025
edited
Loading

Thanks!

I can't see any indication that any build bots enablewarn_default_encoding, but I'm not sure how to confirm!

FWIW, when I backport this to the pathlib-abc pypi package, I'll addPYTHONWARNDEFAULTENCODING = 1 to tox.ini. There's a similar setup in the zipp package and thezipfile.Path tests

@JelleZijlstra
Copy link
Member

I'd prefer if these tests are exercised in some way in CPython's own CI but up to you if you prefer a different approach; feel free to merge as is.

@barneygale
Copy link
ContributorAuthor

Thanks Jelle.

I'll get these tests running in CPython CI in a follow-up PR, because I suspect the same fix will be useful in thezipfile.Path tests, and that'll need to land upstream inzipp first.

JelleZijlstra reacted with thumbs up emoji

@barneygalebarneygale merged commitfbffd70 intopython:mainApr 28, 2025
42 checks passed
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@JelleZijlstraJelleZijlstraJelleZijlstra approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

2 participants
@barneygale@JelleZijlstra

[8]ページ先頭

©2009-2025 Movatter.jp