-
-
Notifications
You must be signed in to change notification settings - Fork 33.2k
Closed as not planned
Closed as not planned
Copy link
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
Proposal:
Summary
- We relocate
contextlib.chdir
toshutil.chdir_context
. - We silently change the
contextlib.chdir
member to be a compatibility import, which can be removed when Python <=3.13 is no longer supported, for a gentle deprecation path.
Rationale
This is really part (2/2) of #128432 which is resolved by the pending #128433. The naming convention chdir_context
follows umask_context
. Documentation re-organising, and code style introduced in #128433 allows this one to slot right in.
contextlib
shouldn't have been the location that chdir
was added to in the first place, and now is the opportune time to correct this mis-step.
PR Preview
Git (re)based on #128433, the PR draft branch is on my fork
Discussions
Has this already been discussed elsewhere?
I have already discussed this feature proposal on Discourse
Links to previous discussion of this feature:
https://discuss.python.org/t/move-contextlib-chdir-to-become-shutil-chdir/76007/
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytype-featureA feature request or enhancementA feature request or enhancement