diff --git a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt index d76c31595ec8..bb7f4bba4c2f 100644 --- a/stdlib/@tests/stubtest_allowlists/darwin-py313.txt +++ b/stdlib/@tests/stubtest_allowlists/darwin-py313.txt @@ -2,9 +2,4 @@ # >= 3.13 # ======= -# Depends on HAVE_NCURSESW and how we install CPython, -# should be removed when 3.13 will be officially released: -_?curses.unget_wch -_?curses.window.get_wch - (mmap.MAP_32BIT)? # Exists locally on MacOS but not on GitHub diff --git a/stdlib/@tests/stubtest_allowlists/py310.txt b/stdlib/@tests/stubtest_allowlists/py310.txt index 9f6ce2cf82e6..d2d31ee8ef53 100644 --- a/stdlib/@tests/stubtest_allowlists/py310.txt +++ b/stdlib/@tests/stubtest_allowlists/py310.txt @@ -290,3 +290,8 @@ sunau.Au_write.initfp threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature typing_extensions\.Annotated # Undocumented implementation details + +# Incompatible changes introduced in Python 3.10.17 +# (Remove once 3.10.17 becomes available for all platforms) +(email._header_value_parser.get_encoded_word)? +(email._header_value_parser.make_quoted_pairs)? diff --git a/stdlib/@tests/stubtest_allowlists/py311.txt b/stdlib/@tests/stubtest_allowlists/py311.txt index 2b7e1b3e527c..92a7543862d7 100644 --- a/stdlib/@tests/stubtest_allowlists/py311.txt +++ b/stdlib/@tests/stubtest_allowlists/py311.txt @@ -254,3 +254,8 @@ sunau.Au_write.initfp threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature typing_extensions\.Annotated # Undocumented implementation details + +# Incompatible changes introduced in Python 3.11.12 +# (Remove once 3.11.12 becomes available for all platforms) +(email._header_value_parser.get_encoded_word)? +(email._header_value_parser.make_quoted_pairs)? diff --git a/stdlib/@tests/stubtest_allowlists/py39.txt b/stdlib/@tests/stubtest_allowlists/py39.txt index e84afe3defe7..04e9978a1ed6 100644 --- a/stdlib/@tests/stubtest_allowlists/py39.txt +++ b/stdlib/@tests/stubtest_allowlists/py39.txt @@ -241,3 +241,7 @@ sunau.Au_write.initfp threading.Lock # Factory function at runtime, but that wouldn't let us use it in type hints types.SimpleNamespace.__init__ # class doesn't accept positional arguments but has default C signature typing_extensions\.Annotated # Undocumented implementation details + +# Incompatible changes introduced in Python 3.9.22 +# (Remove once 3.9.22 becomes available for all platforms) +(email._header_value_parser.get_encoded_word)? diff --git a/stdlib/_curses.pyi b/stdlib/_curses.pyi index 23dead01e6ca..d7820c72c090 100644 --- a/stdlib/_curses.pyi +++ b/stdlib/_curses.pyi @@ -95,13 +95,14 @@ BUTTON4_DOUBLE_CLICKED: int BUTTON4_PRESSED: int BUTTON4_RELEASED: int BUTTON4_TRIPLE_CLICKED: int -# Darwin ncurses doesn't provide BUTTON5_* constants -if sys.version_info >= (3, 10) and sys.platform != "darwin": - BUTTON5_PRESSED: int - BUTTON5_RELEASED: int - BUTTON5_CLICKED: int - BUTTON5_DOUBLE_CLICKED: int - BUTTON5_TRIPLE_CLICKED: int +# Darwin ncurses doesn't provide BUTTON5_* constants prior to 3.12.10 and 3.13.3 +if sys.version_info >= (3, 10): + if sys.version_info >= (3, 12) or sys.platform != "darwin": + BUTTON5_PRESSED: int + BUTTON5_RELEASED: int + BUTTON5_CLICKED: int + BUTTON5_DOUBLE_CLICKED: int + BUTTON5_TRIPLE_CLICKED: int BUTTON_ALT: int BUTTON_CTRL: int BUTTON_SHIFT: int diff --git a/stdlib/_socket.pyi b/stdlib/_socket.pyi index 1a25fc6b13a8..5399f4edf010 100644 --- a/stdlib/_socket.pyi +++ b/stdlib/_socket.pyi @@ -78,7 +78,7 @@ if sys.platform == "win32": SO_EXCLUSIVEADDRUSE: int if sys.platform != "win32": SO_REUSEPORT: int - if sys.platform != "darwin": + if sys.platform != "darwin" or sys.version_info >= (3, 13): SO_BINDTODEVICE: int if sys.platform != "win32" and sys.platform != "darwin": diff --git a/stdlib/email/_header_value_parser.pyi b/stdlib/email/_header_value_parser.pyi index a4c2d8b1a92e..f4e9ca68d6a9 100644 --- a/stdlib/email/_header_value_parser.pyi +++ b/stdlib/email/_header_value_parser.pyi @@ -22,7 +22,8 @@ NLSET: Final[set[str]] # Added in Python 3.8.20, 3.9.20, 3.10.15, 3.11.10, 3.12.5 SPECIALSNL: Final[set[str]] -if sys.version_info >= (3, 12): +if sys.version_info >= (3, 10): + # Added in Python 3.10.17, 3.11.12, 3.12.9, 3.13.2 (may still be backported to 3.9) def make_quoted_pairs(value: Any) -> str: ... def quote_string(value: Any) -> str: ... @@ -349,7 +350,7 @@ ListSeparator: Final[ValueTerminal] RouteComponentMarker: Final[ValueTerminal] def get_fws(value: str) -> tuple[WhiteSpaceTerminal, str]: ... -def get_encoded_word(value: str) -> tuple[EncodedWord, str]: ... +def get_encoded_word(value: str, terminal_type: str = "vtext") -> tuple[EncodedWord, str]: ... def get_unstructured(value: str) -> UnstructuredTokenList: ... def get_qp_ctext(value: str) -> tuple[WhiteSpaceTerminal, str]: ... def get_qcontent(value: str) -> tuple[ValueTerminal, str]: ... diff --git a/stdlib/importlib/resources/__init__.pyi b/stdlib/importlib/resources/__init__.pyi index 88ce8f5cef48..2cf6366b6cb3 100644 --- a/stdlib/importlib/resources/__init__.pyi +++ b/stdlib/importlib/resources/__init__.pyi @@ -37,11 +37,12 @@ if sys.version_info < (3, 11): elif sys.version_info < (3, 13): Resource: TypeAlias = str -if sys.version_info >= (3, 13): +if sys.version_info >= (3, 12): from importlib.resources._common import Anchor as Anchor __all__ += ["Anchor"] +if sys.version_info >= (3, 13): from importlib.resources._functional import ( contents as contents, is_resource as is_resource, diff --git a/stdlib/multiprocessing/resource_tracker.pyi b/stdlib/multiprocessing/resource_tracker.pyi index 61da7fdf1ceb..cb2f27a62861 100644 --- a/stdlib/multiprocessing/resource_tracker.pyi +++ b/stdlib/multiprocessing/resource_tracker.pyi @@ -1,3 +1,4 @@ +import sys from _typeshed import FileDescriptorOrPath from collections.abc import Sized @@ -8,6 +9,8 @@ class ResourceTracker: def ensure_running(self) -> None: ... def register(self, name: Sized, rtype: str) -> None: ... def unregister(self, name: Sized, rtype: str) -> None: ... + if sys.version_info >= (3, 12): + def __del__(self) -> None: ... _resource_tracker: ResourceTracker ensure_running = _resource_tracker.ensure_running diff --git a/stdlib/socket.pyi b/stdlib/socket.pyi index 680c6475a3b7..ff89dcc72209 100644 --- a/stdlib/socket.pyi +++ b/stdlib/socket.pyi @@ -514,7 +514,7 @@ if sys.platform != "win32": "IPV6_RTHDRDSTOPTS", ] - if sys.platform != "darwin": + if sys.platform != "darwin" or sys.version_info >= (3, 13): from _socket import SO_BINDTODEVICE as SO_BINDTODEVICE __all__ += ["SO_BINDTODEVICE"] diff --git a/stdlib/tokenize.pyi b/stdlib/tokenize.pyi index a1c4b412da83..86e87704eb02 100644 --- a/stdlib/tokenize.pyi +++ b/stdlib/tokenize.pyi @@ -125,7 +125,7 @@ class Untokenizer: prev_col: int encoding: str | None def add_whitespace(self, start: _Position) -> None: ... - if sys.version_info >= (3, 13): + if sys.version_info >= (3, 12): def add_backslash_continuation(self, start: _Position) -> None: ... def untokenize(self, iterable: Iterable[_Token]) -> str: ...