Skip to main content

contextlib-chdir

Backport of contextlib.chdir stdlib class added in Python3.11.

Install

pip install contextlib-chdir

Usage

import os
import tempfile
from contextlib_chdir import chdir as chdir_ctx

with chdir_ctx(tempfile.gettempdir()):
    print(os.getcwd())  # /tmp

Note

You'll probably want to migrate to contextlib2 when this change is included.

Release files for contextlib-chdir 1.0.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for contextlib-chdir 1.0.2
File Size Uploaded
contextlib-chdir-1.0.2.tar.gz 1.9 kB Details

Built distribution (wheel)

Table of built distributions (wheels) for contextlib-chdir 1.0.2
File Interpreter ABI Platform
contextlib_chdir-1.0.2-py3-none-any.whl Python 3 none any Details

Total release size: 4.0 kB

Release files / contextlib-chdir-1.0.2.tar.gz

Download URL contextlib-chdir-1.0.2.tar.gz
Size 1.9 kB
Tags Source
SHA-256 checksum
How to use checksums
58406a71db00647fcccfc7e52e9e04e44d29eacf30400e7c0ba3b15f09d5f3fa
BLAKE2b-256 checksum
How to use checksums
f9ac1b3022cc91497b45a653e86fa91694a63684904388440d71e58ff531687b
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release files / contextlib_chdir-1.0.2-py3-none-any.whl

Download URL contextlib_chdir-1.0.2-py3-none-any.whl
Size 2.2 kB
Tags Python 3
SHA-256 checksum
How to use checksums
f72f7abd0f87c18a57aee30acf97659ca315157e50bd07e084b8737e0719de3c
BLAKE2b-256 checksum
How to use checksums
7fac2de09f29c85a1c91d45bbb394d339dbda2b9fcf64d5a43895d2e643b9c39
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/4.0.1 CPython/3.7.13

Release history Release notifications | RSS feed

This release

1.0.2 This release

2 release files

1.0.1

2 release files

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page