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-101144: Allow open and read_text encoding to be positional.#101145

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

gpshead
Copy link
Member

@gpsheadgpshead commentedJan 19, 2023
edited by bedevere-bot
Loading

This was the behavior in 3.9 and earlier. The fix for#87817 introduced an API regression in 3.10.0b1.

As was the behavior in 3.9 and earlier.  The fix forpython#87817 introduced an APIregression in 3.10.0b1.
@gpsheadgpshead self-assigned thisJan 19, 2023
@gpsheadgpshead added needs backport to 3.10only security fixes needs backport to 3.11only security fixes type-bugAn unexpected behavior, bug, or error stdlibPython modules in the Lib dir labelsJan 19, 2023
This preserves the intent ofpython#87817 while restoring theability to pass `encoding` as a positional argument.
@gpsheadgpshead marked this pull request as ready for reviewJanuary 19, 2023 02:30
@gpshead
Copy link
MemberAuthor

(internally at work the bug this fixes comes from b/266007820)

Copy link
Member

@jaracojaraco left a comment

Choose a reason for hiding this comment

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

This change will need to be ported to zipp as well.

If only the affected user had been using the backport for forward-compatibility, they would have discovered this issue much earlier. On further consideration, I guess it's not a matter of forward compatibility (as zipp will often be ahead of some slightly stale Python version). The issue really lies in that the code is only tested on one major version.

This change is mostly fine, but I have some concerns I'd like to see investigated/addressed before proceeding.

@bedevere-bot
Copy link

When you're done making the requested changes, leave the comment:I have made the requested changes; please review again.

@gpshead
Copy link
MemberAuthor

I have made the requested changes; please review again.

@bedevere-bot
Copy link

Thanks for making the requested changes!

@methane,@jaraco: please review the changes made to this pull request.

@gpsheadgpshead merged commit5927013 intopython:mainJan 20, 2023
@miss-islington
Copy link
Contributor

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

@gpsheadgpshead deleted the regression/zipfile.Path.read_text/gh-101144 branchJanuary 20, 2023 07:04
@miss-islington
Copy link
Contributor

Sorry,@gpshead, I could not cleanly backport this to3.11 due to a conflict.
Please backport usingcherry_picker on command line.
cherry_picker 5927013e47a8c63b70e104152351f3447baa819c 3.11

@miss-islington
Copy link
Contributor

Sorry@gpshead, I had trouble checking out the3.10 backport branch.
Please retry by removing and re-adding the "needs backport to 3.10" label.
Alternatively, you can backport usingcherry_picker on the command line.
cherry_picker 5927013e47a8c63b70e104152351f3447baa819c 3.10

gpshead added a commit to gpshead/cpython that referenced this pull requestJan 20, 2023
…ional. (pythonGH-101145)The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only.Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time..(cherry picked from commit5927013)Co-authored-by: Gregory P. Smith <greg@krypto.org>
@gpsheadgpshead removed the needs backport to 3.10only security fixes labelJan 20, 2023
@gpshead
Copy link
MemberAuthor

#101179 applies it to 3.11 and will be proposed as a 3.10 backport, though we may just update the 3.10 docs and not fix it in that branch.

@gpsheadgpshead removed the needs backport to 3.11only security fixes labelJan 20, 2023
jaraco pushed a commit to jaraco/zipp that referenced this pull requestJan 27, 2023
…onal. (python/cpython#101145)The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only.Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time.
jaraco pushed a commit to jaraco/zipp that referenced this pull requestJan 27, 2023
…onal. (python/cpython#101145)The zipfile.Path open() and read_text() encoding parameter can be supplied as a positional argument without causing a TypeError again. 3.10.0b1 included a regression that made it keyword only.Documentation update included as users writing code to be compatible with a wide range of versions will need to consider this for some time.
clrpackages pushed a commit to clearlinux-pkgs/pypi-zipp that referenced this pull requestJan 30, 2023
…n 3.12.0Gregory P. Smith (1):python/cpython#101144: Allow open and read_text encoding to be positional. (python/cpython#101145)Jason R. Coombs (13):      Honor ResourceWarnings.Fixesjaraco/skeleton#73.      tox 4 requires a boolean value, so use '1' to FORCE_COLOR.Fixesjaraco/skeleton#74.      Remove unnecessary shebang and encoding header in docs conf.      Prevent Python 3.12 from blocking checks.      Build docs in CI, including sphinx-lint.      Put tidelift docs dependency in its own section to limit merge conflicts.      Update badge for 2023      Update changelog. Refpython/cpython#101144.      Invoke test_encoding_warnings in-process, but skip when warn_default_encoding is not set. Re-use alpharep fixture for the file.      Provide 'sys.flags.warn_default_encoding' for the tests to skip prior to 3.10.      Due to mypy, it's not possible to patch the value, so just be lenient in access.      Prefer simple asserts      Replace trailing comment with a comment on a separate line.
Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@methanemethanemethane approved these changes

@jaracojaracojaraco approved these changes

Assignees

@gpsheadgpshead

Labels
stdlibPython modules in the Lib dirtype-bugAn unexpected behavior, bug, or error
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

5 participants
@gpshead@bedevere-bot@miss-islington@methane@jaraco

[8]ページ先頭

©2009-2025 Movatter.jp