bpo-25625: add contextlib.chdir by FFY00 · Pull Request #28271 · python/cpython · GitHub

github.com

Tin mới

GitHub CopilotWrite better code with AI

GitHub Copilot appDirect agents from issue to merge

ActionsAutomate any workflow

CodespacesInstant dev environments

IssuesPlan and track work

Code ReviewManage code changes

Code QualityEnforce quality at merge

GitHub Advanced SecurityFind and fix vulnerabilities

Code securitySecure your code as you build

Secret protectionStop leaks before they start

View all use cases

Financial services

View all industries

Software Development

GitHub SponsorsFund open source developers

Copilot for BusinessEnterprise-grade AI features

Premium SupportEnterprise-grade 24/7 support

Pull requests 2.6k

Security and quality 0

bpo-25625: add contextlib.chdir

View reviewed changes

Ensure own exception

View reviewed changes

View reviewed changes

Update Lib/test/test_contextlib.py

View reviewed changes

Serhiy's feedback Signed-off-by: Filipe Laíns <[email protected]>

View reviewed changes

Learn more about hiding disruptive comments

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

Please decide on chdir() / workdir() context manager python/steering-council#77

we already do support that

The presence of a chdir decorator in Python's stdlib promotes the idea that the feature is a good standard practice. However it is ill-advised to change process global state such as the working directory in most cases.

Merge main to work around BPO-45220 unrelated Windows failures

refeer that the cm is not parallel-safe in the news entry

fix typo in news Signed-off-by: Filipe Laíns <[email protected]>

View reviewed changes

add contextlib.chdir python/typeshed#6191

ENH: Add slicer.util.chdir context manager

ENH: Add slicer.util.chdir context manager Slicer/Slicer#6341

ENH: Add slicer.util.chdir context manager

shutil.make_archive should not need to chdir (alternatively: make shutil.make_archive thread-safe) #74696

add context manager for changing directories AnswerDotAI/fastcore#436