From 7e58c9a992ca3724d4b835bd590bca4b66a7b202 Mon Sep 17 00:00:00 2001 From: donBarbos Date: Tue, 29 Jul 2025 19:58:53 +0400 Subject: [PATCH] [sys] Deprecate `_enablelegacywindowsfsencoding` Source: https://github.com/python/cpython/pull/107729 --- stdlib/sys/__init__.pyi | 9 ++++++++- 1 file changed, 8 insertions(+), 1 deletion(-) diff --git a/stdlib/sys/__init__.pyi b/stdlib/sys/__init__.pyi index 0ca30396a878..a5c2ad36026e 100644 --- a/stdlib/sys/__init__.pyi +++ b/stdlib/sys/__init__.pyi @@ -454,7 +454,14 @@ def get_asyncgen_hooks() -> _asyncgen_hooks: ... def set_asyncgen_hooks(firstiter: _AsyncgenHook = ..., finalizer: _AsyncgenHook = ...) -> None: ... if sys.platform == "win32": - def _enablelegacywindowsfsencoding() -> None: ... + if sys.version_info >= (3, 13): + @deprecated( + "Deprecated since Python 3.13; will be removed in Python 3.16. " + "Use the `PYTHONLEGACYWINDOWSFSENCODING` environment variable instead." + ) + def _enablelegacywindowsfsencoding() -> None: ... + else: + def _enablelegacywindowsfsencoding() -> None: ... def get_coroutine_origin_tracking_depth() -> int: ... def set_coroutine_origin_tracking_depth(depth: int) -> None: ...