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

FFY00 · GitHub

This is probably the single snippet of code I find myself re-implementing the most in projects. Not being thread safe is not optimal, but there isn't really any good way to do so, and that does not negate the huge usefulness of this function. Signed-off-by: Filipe Laíns <[email protected]>

kalvdans
kalvdans

Co-authored-by: Filipe Laíns <[email protected]>

Signed-off-by: Filipe Laíns <[email protected]>

tiran

mentioned this pull request

Sep 15, 2021

Closed

Signed-off-by: Filipe Laíns <[email protected]>

Signed-off-by: Filipe Laíns <[email protected]>

Merged

jcfr

added a commit to jcfr/Slicer that referenced this pull request

Apr 29, 2022

This commit implements a non thread-safe context manager to change the current working directory. Available in Python 3.11 as ``contextlib.chdir`` and adapted from

python/cpython#28271

.

jcfr

mentioned this pull request

Apr 29, 2022

Merged

jcfr

added a commit to Slicer/Slicer that referenced this pull request

Apr 29, 2022

This commit implements a non thread-safe context manager to change the current working directory. Available in Python 3.11 as ``contextlib.chdir`` and adapted from

python/cpython#28271

. Closed

Closed