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-83863: Drop support for usingpathlib.Path objects as context managers#104807

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

Conversation

barneygale
Copy link
Contributor

@barneygalebarneygale commentedMay 23, 2023
edited by bedevere-bot
Loading

In Python 3.8 and prior,pathlib.Path.__exit__() marked a path as closed; some subsequent attempts to perform I/O would raise an IOError. This functionality was never documented, and had the effect of makingPath objects mutable, contrary to PEP 428. In Python 3.9 we made__exit__() a no-op, and in 3.11__enter__() began raising deprecation warnings. Here we remove both methods.

…ext managersIn Python 3.8 and prior, `pathlib.Path.__exit__()` marked a path as closed;some subsequent attempts to perform I/O would raise an IOError. Thisfunctionality was never documented, and had the effect of making `Path`objects mutable, contrary to PEP 428. In Python 3.9 we made `__exit__()` ano-op, and in 3.11 `__enter__()` began raising deprecation warnings. Herewe remove both methods.
Copy link
Member

@AlexWaygoodAlexWaygood left a comment

Choose a reason for hiding this comment

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

Hooray! Maybe worth an entry in "what's new in 3.13"?

barneygale reacted with thumbs up emoji
@barneygale
Copy link
ContributorAuthor

Thanks Alex!

AlexWaygood reacted with rocket emoji

@barneygalebarneygaleenabled auto-merge (squash)May 23, 2023 22:17
@barneygalebarneygale merged commit6b1510c intopython:mainMay 23, 2023
@bedevere-bot
Copy link

⚠️⚠️⚠️ Buildbot failure⚠️⚠️⚠️

Hi! The buildbots390x SLES 3.x has failed when building commit6b1510c.

What do you need to do:

  1. Don't panic.
  2. Checkthe buildbot page in the devguide if you don't know what the buildbots are or how they work.
  3. Go to the page of the buildbot that failed (https://buildbot.python.org/all/#builders/540/builds/5391) and take a look at the build logs.
  4. Check if the failure is related to this commit (6b1510c) or if it is a false positive.
  5. If the failure is related to this commit, please, reflect that on the issue and make a new Pull Request with a fix.

You can take a look at the buildbot page here:

https://buildbot.python.org/all/#builders/540/builds/5391

Failed tests:

  • test_threading

Summary of the results of the build (if available):

== Tests result: FAILURE then ENV CHANGED ==

445 tests OK.

10 slowest tests:

  • test_concurrent_futures: 2 min 24 sec
  • test_tools: 2 min 10 sec
  • test_multiprocessing_spawn: 1 min 59 sec
  • test_math: 1 min 30 sec
  • test_multiprocessing_forkserver: 1 min 22 sec
  • test_signal: 1 min 11 sec
  • test_multiprocessing_fork: 1 min 5 sec
  • test_capi: 1 min 1 sec
  • test_gdb: 43.2 sec
  • test_io: 36.8 sec

1 test altered the execution environment:
test_socketserver

19 tests skipped:
test.test_asyncio.test_windows_events
test.test_asyncio.test_windows_utils test_devpoll test_ioctl
test_kqueue test_launcher test_msilib test_nis test_peg_generator
test_perf_profiler test_startfile test_tix test_tkinter test_ttk
test_winconsoleio test_winreg test_winsound test_wmi
test_zipfile64

1 re-run test:
test_threading

Total duration: 6 min 41 sec

Click to see traceback logs
remote:Enumerating objects: 26, done.remote:Counting objects:   3% (1/26)remote:Counting objects:   7% (2/26)remote:Counting objects:  11% (3/26)remote:Counting objects:  15% (4/26)remote:Counting objects:  19% (5/26)remote:Counting objects:  23% (6/26)remote:Counting objects:  26% (7/26)remote:Counting objects:  30% (8/26)remote:Counting objects:  34% (9/26)remote:Counting objects:  38% (10/26)remote:Counting objects:  42% (11/26)remote:Counting objects:  46% (12/26)remote:Counting objects:  50% (13/26)remote:Counting objects:  53% (14/26)remote:Counting objects:  57% (15/26)remote:Counting objects:  61% (16/26)remote:Counting objects:  65% (17/26)remote:Counting objects:  69% (18/26)remote:Counting objects:  73% (19/26)remote:Counting objects:  76% (20/26)remote:Counting objects:  80% (21/26)remote:Counting objects:  84% (22/26)remote:Counting objects:  88% (23/26)remote:Counting objects:  92% (24/26)remote:Counting objects:  96% (25/26)remote:Counting objects: 100% (26/26)remote:Counting objects: 100% (26/26), done.remote:Compressing objects:  10% (1/10)remote:Compressing objects:  20% (2/10)remote:Compressing objects:  30% (3/10)remote:Compressing objects:  40% (4/10)remote:Compressing objects:  50% (5/10)remote:Compressing objects:  60% (6/10)remote:Compressing objects:  70% (7/10)remote:Compressing objects:  80% (8/10)remote:Compressing objects:  90% (9/10)remote:Compressing objects: 100% (10/10)remote:Compressing objects: 100% (10/10), done.remote:Total 14 (delta 12), reused 5 (delta 4), pack-reused 0From https://github.com/python/cpython * branch                  main       -> FETCH_HEADNote:switching to '6b1510cf11c16c8e4381810c15ceeda6f89e79f4'.You are in 'detached HEAD' state. You can look around, make experimentalchanges and commit them, and you can discard any commits you make in thisstate without impacting any branches by switching back to a branch.If you want to create a new branch to retain commits you create, you maydo so (now or later) by using -c with the switch command. Example:  git switch -c <new-branch-name>Or undo this operation with:  git switch -Turn off this advice by setting config variable advice.detachedHead to falseHEAD is now at 6b1510cf11 GH-83863: Drop support for using `pathlib.Path` objects as context managers (GH-104807)Switched to and reset branch 'main'./configure:line 8401: -reorder-blocks=ext-tsp: command not foundmake:*** [Makefile:2008: buildbottest] Error 3

Sign up for freeto join this conversation on GitHub. Already have an account?Sign in to comment
Reviewers

@AlexWaygoodAlexWaygoodAlexWaygood approved these changes

Assignees
No one assigned
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

3 participants
@barneygale@bedevere-bot@AlexWaygood

[8]ページ先頭

©2009-2025 Movatter.jp