From ff5f8a0bf7b56b3d95b18ca56bad68b4d1e9242b Mon Sep 17 00:00:00 2001 From: Cody Maloney Date: Mon, 6 Jul 2026 08:40:45 -0700 Subject: [PATCH] Docs: Link to the `contextlib.chdir` context manager in the `os.chdir` docs (GH-153152) (cherry picked from commit f155dbed4ef30dec5d00b8b09524b0d9f63965bc) Co-authored-by: Cody Maloney Co-authored-by: Stan Ulbrych --- Doc/library/os.rst | 5 +++++ 1 file changed, 5 insertions(+) diff --git a/Doc/library/os.rst b/Doc/library/os.rst index 778ab8714e1117..fba6ece80e5df5 100644 --- a/Doc/library/os.rst +++ b/Doc/library/os.rst @@ -2180,6 +2180,11 @@ features: .. audit-event:: os.chdir path os.chdir + .. seealso:: + + The :func:`contextlib.chdir` context manager, which changes the current + working directory on entering and restores the previous one on exit. + .. versionchanged:: 3.3 Added support for specifying *path* as a file descriptor on some platforms.