From 691f31685b8680cc5a5c41f7fff84eb0cd79716c Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 21:46:43 -0700 Subject: [PATCH 01/10] Run stubtest for Python 3.12 --- .github/workflows/stubtest_stdlib.yml | 2 +- stdlib/builtins.pyi | 6 +- tests/stubtest_allowlists/darwin-py312.txt | 13 + tests/stubtest_allowlists/darwin.txt | 3 - tests/stubtest_allowlists/linux.txt | 3 - tests/stubtest_allowlists/py310.txt | 6 + tests/stubtest_allowlists/py311.txt | 6 + tests/stubtest_allowlists/py312.txt | 508 +++++++++++++++++++++ tests/stubtest_allowlists/py37.txt | 6 + tests/stubtest_allowlists/py38.txt | 6 + tests/stubtest_allowlists/py39.txt | 6 + tests/stubtest_allowlists/py3_common.txt | 141 ------ tests/stubtest_allowlists/win32-py310.txt | 4 + tests/stubtest_allowlists/win32-py311.txt | 4 + tests/stubtest_allowlists/win32-py312.txt | 14 + tests/stubtest_allowlists/win32-py37.txt | 1 + tests/stubtest_allowlists/win32-py38.txt | 1 + tests/stubtest_allowlists/win32-py39.txt | 4 + tests/stubtest_allowlists/win32.txt | 5 - tests/stubtest_stdlib.py | 1 + 20 files changed, 584 insertions(+), 156 deletions(-) create mode 100644 tests/stubtest_allowlists/darwin-py312.txt create mode 100644 tests/stubtest_allowlists/py312.txt create mode 100644 tests/stubtest_allowlists/win32-py312.txt diff --git a/.github/workflows/stubtest_stdlib.yml b/.github/workflows/stubtest_stdlib.yml index a43e0925a1e8..e1b394f874d1 100644 --- a/.github/workflows/stubtest_stdlib.yml +++ b/.github/workflows/stubtest_stdlib.yml @@ -32,7 +32,7 @@ jobs: matrix: # tkinter doesn't import on macOS 12 os: ["ubuntu-latest", "windows-latest", "macos-11"] - python-version: ["3.7", "3.8", "3.9", "3.10", "3.11"] + python-version: ["3.7", "3.8", "3.9", "3.10", "3.11", "3.12-dev"] fail-fast: false steps: diff --git a/stdlib/builtins.pyi b/stdlib/builtins.pyi index 45a17b33d979..b3871776128a 100644 --- a/stdlib/builtins.pyi +++ b/stdlib/builtins.pyi @@ -53,7 +53,7 @@ from typing import ( # noqa: Y022 overload, type_check_only, ) -from typing_extensions import ( +from typing_extensions import ( # type: ignore Concatenate, Literal, LiteralString, @@ -465,7 +465,7 @@ class str(Sequence[str]): @overload def format(self: LiteralString, *args: LiteralString, **kwargs: LiteralString) -> LiteralString: ... @overload - def format(self, *args: object, **kwargs: object) -> str: ... + def format(self, *args: object, **kwargs: object) -> str: ... # type: ignore def format_map(self, map: _FormatMapMapping) -> str: ... def index(self, __sub: str, __start: SupportsIndex | None = ..., __end: SupportsIndex | None = ...) -> int: ... def isalnum(self) -> bool: ... @@ -595,7 +595,7 @@ class str(Sequence[str]): @overload def __mod__(self: LiteralString, __value: LiteralString | tuple[LiteralString, ...]) -> LiteralString: ... @overload - def __mod__(self, __value: Any) -> str: ... + def __mod__(self, __value: Any) -> str: ... # type: ignore @overload def __mul__(self: LiteralString, __value: SupportsIndex) -> LiteralString: ... @overload diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt new file mode 100644 index 000000000000..388f1d9b1600 --- /dev/null +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -0,0 +1,13 @@ +_?curses.color_pair +xxlimited.Xxo.x_exports + +# Exists at runtime, missing from stub +socket.TCP_CONNECTION_INFO + +(dbm.gnu)? +(locale.bind_textdomain_codeset)? +(locale.bindtextdomain)? +(locale.dcgettext) +(locale.dgettext)? +(locale.gettext)? +(locale.textdomain)? diff --git a/tests/stubtest_allowlists/darwin.txt b/tests/stubtest_allowlists/darwin.txt index 61b54564160f..09333f3fafa3 100644 --- a/tests/stubtest_allowlists/darwin.txt +++ b/tests/stubtest_allowlists/darwin.txt @@ -27,9 +27,6 @@ select.POLLMSG # system dependent (termios.[A-Z0-9_]+)? # Exists at runtime, but missing from stubs -distutils.msvccompiler.MSVCCompiler.get_msvc_paths -distutils.msvccompiler.MSVCCompiler.set_path_env_var -distutils.msvccompiler.MacroExpander mimetypes.MimeTypes.read_windows_registry selectors.DefaultSelector.fileno socket.PF_SYSTEM diff --git a/tests/stubtest_allowlists/linux.txt b/tests/stubtest_allowlists/linux.txt index a10c7fc8d2ed..7dc88a4672f4 100644 --- a/tests/stubtest_allowlists/linux.txt +++ b/tests/stubtest_allowlists/linux.txt @@ -15,9 +15,6 @@ socket.[A-Z0-9_]+ errno.[A-Z0-9]+ # Exists at runtime, but missing from stubs -distutils.msvccompiler.MSVCCompiler.get_msvc_paths -distutils.msvccompiler.MSVCCompiler.set_path_env_var -distutils.msvccompiler.MacroExpander mimetypes.MimeTypes.read_windows_registry selectors.DefaultSelector.fileno spwd.struct_spwd.sp_nam diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index e7849d077e9a..22ace9d96e4c 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -183,3 +183,9 @@ typing.NewType.__call__ typing_extensions\.Final typing\.NamedTuple typing\.Annotated + +# Removed in 3.12 +distutils\..* +asyncore.dispatcher.addr +asyncore.dispatcher.handle_accepted +asynchat.find_prefix_at_end diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index d0ad57c7a2cb..22adf3df1f4b 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -149,3 +149,9 @@ dataclasses.KW_ONLY typing.ParamSpec(Args|Kwargs).__origin__ typing\.TypeVar\.__.*__ typing\.ParamSpec\.__.*__ + +# Removed in 3.12 +distutils\..* +asyncore.dispatcher.addr +asyncore.dispatcher.handle_accepted +asynchat.find_prefix_at_end diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt new file mode 100644 index 000000000000..a49d9ff81e05 --- /dev/null +++ b/tests/stubtest_allowlists/py312.txt @@ -0,0 +1,508 @@ +# Uncategorised, from Python 3.12 +_ctypes.SIZEOF_TIME_T +_curses.color_pair +_posixsubprocess.fork_exec +_thread.daemon_threads_allowed +argparse.BooleanOptionalAction.__init__ +array.array.__class_getitem__ +asyncio.BaseEventLoop.create_connection +asyncio.BaseEventLoop.shutdown_default_executor +asyncio.Handle.get_context +asyncio.StreamWriter.start_tls +asyncio.Task.get_context +asyncio.base_events.BaseEventLoop.create_connection +asyncio.base_events.BaseEventLoop.shutdown_default_executor +asyncio.constants.THREAD_JOIN_TIMEOUT +asyncio.create_eager_task_factory +asyncio.eager_task_factory +asyncio.events.Handle.get_context +asyncio.streams.StreamWriter.start_tls +asyncio.tasks.Task.get_context +asyncio.tasks.__all__ +asyncio.tasks.create_eager_task_factory +asyncio.tasks.eager_task_factory +calendar.APRIL +calendar.AUGUST +calendar.DECEMBER +calendar.Day +calendar.FEBRUARY +calendar.JANUARY +calendar.JULY +calendar.JUNE +calendar.MARCH +calendar.MAY +calendar.Month +calendar.NOVEMBER +calendar.OCTOBER +calendar.SEPTEMBER +calendar.__all__ +collections.UserDict.get +configparser.ParsingError.__init__ +configparser.RawConfigParser.readfp +configparser.__all__ +ctypes.c_time_t +curses.color_pair +datetime.__all__ +dis.__all__ +dis.hasarg +dis.hasexc +dis.hasnargs +distutils +distutils.archive_util +distutils.bcppcompiler +distutils.ccompiler +distutils.cmd +distutils.command +distutils.command.config +distutils.config +distutils.core +distutils.cygwinccompiler +distutils.debug +distutils.dep_util +distutils.dir_util +distutils.dist +distutils.errors +distutils.extension +distutils.fancy_getopt +distutils.file_util +distutils.filelist +distutils.log +distutils.msvccompiler +distutils.spawn +distutils.sysconfig +distutils.text_file +distutils.unixccompiler +distutils.util +distutils.version +email.utils.localtime +enum.Enum.__signature__ +enum.EnumMeta.__call__ +enum.EnumType.__call__ +enum.property.member +fcntl.FICLONE +fcntl.FICLONERANGE +ftplib.FTP_TLS.__init__ +functools.WRAPPER_ASSIGNMENTS +functools.update_wrapper +functools.wraps +genericpath.__all__ +genericpath.islink +gzip.GzipFile.filename +http.HTTPStatus.is_client_error +http.HTTPStatus.is_informational +http.HTTPStatus.is_redirection +http.HTTPStatus.is_server_error +http.HTTPStatus.is_success +http.client.HTTPConnection.get_proxy_response_headers +http.client.HTTPSConnection.__init__ +imaplib.IMAP4_SSL.__init__ +imp +importlib.abc.Finder +importlib.abc.Loader.module_repr +importlib.abc.MetaPathFinder.find_module +importlib.abc.PathEntryFinder.find_loader +importlib.abc.PathEntryFinder.find_module +importlib.abc.__all__ +importlib.find_loader +importlib.machinery.BuiltinImporter.find_module +importlib.machinery.BuiltinImporter.module_repr +importlib.machinery.FrozenImporter.find_module +importlib.machinery.FrozenImporter.module_repr +importlib.machinery.PathFinder.find_module +importlib.machinery.WindowsRegistryFinder.find_module +importlib.metadata.PackageMetadata.get +importlib.metadata.SelectableGroups +importlib.metadata._meta.PackageMetadata.get +importlib.metadata._meta.SimplePath.__truediv__ +importlib.metadata._meta.SimplePath.parent +importlib.resources.files +importlib.util.allowing_all_extensions +importlib.util.module_for_loader +importlib.util.set_loader +importlib.util.set_package +inspect.AGEN_CLOSED +inspect.AGEN_CREATED +inspect.AGEN_RUNNING +inspect.AGEN_SUSPENDED +inspect.__all__ +inspect.getasyncgenlocals +inspect.getasyncgenstate +inspect.markcoroutinefunction +locale.format +logging.Logger.getChildren +logging.__all__ +logging.getHandlerByName +logging.getHandlerNames +mmap.MAP_STACK +multiprocessing.connection.deliver_challenge +multiprocessing.queues.Queue.__class_getitem__ +ntpath.__all__ +ntpath.isjunction +ntpath.splitroot +opcode.__all__ +opcode.hasarg +opcode.hasexc +opcode.hasnargs +os.CLONE_FILES +os.CLONE_FS +os.CLONE_NEWCGROUP +os.CLONE_NEWIPC +os.CLONE_NEWNET +os.CLONE_NEWNS +os.CLONE_NEWPID +os.CLONE_NEWUSER +os.CLONE_NEWUTS +os.CLONE_SIGHAND +os.CLONE_SYSVSEM +os.CLONE_THREAD +os.CLONE_VM +os.DirEntry.is_junction +os.EFD_CLOEXEC +os.EFD_NONBLOCK +os.EFD_SEMAPHORE +os.SPLICE_F_MORE +os.SPLICE_F_MOVE +os.SPLICE_F_NONBLOCK +os.eventfd +os.eventfd_read +os.eventfd_write +os.path.__all__ +os.path.isjunction +os.path.splitroot +os.sendfile +os.setns +os.setresgid +os.setresuid +os.splice +os.unshare +pathlib.Path.__init__ +pathlib.Path.exists +pathlib.Path.glob +pathlib.Path.is_junction +pathlib.Path.rglob +pathlib.PurePath.__init__ +pathlib.PurePath.is_relative_to +pathlib.PurePath.match +pathlib.PurePath.relative_to +pathlib.PurePath.with_segments +pdb.Pdb.set_convenience_variable +pkgutil.ImpImporter +pkgutil.ImpLoader +pkgutil.__all__ +poplib.POP3_SSL.__init__ +posix.CLONE_FILES +posix.CLONE_FS +posix.CLONE_NEWCGROUP +posix.CLONE_NEWIPC +posix.CLONE_NEWNET +posix.CLONE_NEWNS +posix.CLONE_NEWPID +posix.CLONE_NEWUSER +posix.CLONE_NEWUTS +posix.CLONE_SIGHAND +posix.CLONE_SYSVSEM +posix.CLONE_THREAD +posix.CLONE_VM +posix.DirEntry.is_junction +posix.EFD_CLOEXEC +posix.EFD_NONBLOCK +posix.EFD_SEMAPHORE +posix.SPLICE_F_MORE +posix.SPLICE_F_MOVE +posix.SPLICE_F_NONBLOCK +posix.eventfd +posix.eventfd_read +posix.eventfd_write +posix.sendfile +posix.setns +posix.setresgid +posix.setresuid +posix.splice +posix.unshare +posixpath.__all__ +posixpath.isjunction +posixpath.splitroot +pydoc.HTMLRepr.__init__ +pydoc.TextRepr.__init__ +resource.prlimit +signal.sigtimedwait +signal.sigwaitinfo +smtplib.SMTP.starttls +smtplib.SMTP_SSL.__init__ +sqlite3.Connection.autocommit +sqlite3.Connection.getconfig +sqlite3.Connection.setconfig +sqlite3.LEGACY_TRANSACTION_CONTROL +sqlite3.SQLITE_DBCONFIG_DEFENSIVE +sqlite3.SQLITE_DBCONFIG_DQS_DDL +sqlite3.SQLITE_DBCONFIG_DQS_DML +sqlite3.SQLITE_DBCONFIG_ENABLE_FKEY +sqlite3.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER +sqlite3.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION +sqlite3.SQLITE_DBCONFIG_ENABLE_QPSG +sqlite3.SQLITE_DBCONFIG_ENABLE_TRIGGER +sqlite3.SQLITE_DBCONFIG_ENABLE_VIEW +sqlite3.SQLITE_DBCONFIG_LEGACY_ALTER_TABLE +sqlite3.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +sqlite3.SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE +sqlite3.SQLITE_DBCONFIG_RESET_DATABASE +sqlite3.SQLITE_DBCONFIG_TRIGGER_EQP +sqlite3.SQLITE_DBCONFIG_TRUSTED_SCHEMA +sqlite3.SQLITE_DBCONFIG_WRITABLE_SCHEMA +sqlite3.dbapi2.Connection.autocommit +sqlite3.dbapi2.Connection.getconfig +sqlite3.dbapi2.Connection.setconfig +sqlite3.dbapi2.LEGACY_TRANSACTION_CONTROL +sqlite3.dbapi2.SQLITE_DBCONFIG_DEFENSIVE +sqlite3.dbapi2.SQLITE_DBCONFIG_DQS_DDL +sqlite3.dbapi2.SQLITE_DBCONFIG_DQS_DML +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_FKEY +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_FTS3_TOKENIZER +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_LOAD_EXTENSION +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_QPSG +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_TRIGGER +sqlite3.dbapi2.SQLITE_DBCONFIG_ENABLE_VIEW +sqlite3.dbapi2.SQLITE_DBCONFIG_LEGACY_ALTER_TABLE +sqlite3.dbapi2.SQLITE_DBCONFIG_LEGACY_FILE_FORMAT +sqlite3.dbapi2.SQLITE_DBCONFIG_NO_CKPT_ON_CLOSE +sqlite3.dbapi2.SQLITE_DBCONFIG_RESET_DATABASE +sqlite3.dbapi2.SQLITE_DBCONFIG_TRIGGER_EQP +sqlite3.dbapi2.SQLITE_DBCONFIG_TRUSTED_SCHEMA +sqlite3.dbapi2.SQLITE_DBCONFIG_WRITABLE_SCHEMA +sqlite3.dbapi2.enable_shared_cache +sqlite3.enable_shared_cache +sre_parse.Tokenizer.checkgroupname +sre_parse.expand_template +sre_parse.parse_template +ssl.OP_ENABLE_KTLS +ssl.OP_LEGACY_SERVER_CONNECT +ssl.Options.OP_ENABLE_KTLS +ssl.Options.OP_LEGACY_SERVER_CONNECT +ssl.RAND_pseudo_bytes +ssl.wrap_socket +sys.activate_stack_trampoline +sys.deactivate_stack_trampoline +sys.getunicodeinternedsize +sys.is_stack_trampoline_active +syslog.LOG_MASK +syslog.LOG_UPTO +syslog.setlogmask +tarfile.AbsoluteLinkError +tarfile.AbsolutePathError +tarfile.FilterError +tarfile.LinkOutsideDestinationError +tarfile.OutsideDestinationError +tarfile.SpecialFileError +tarfile.TarFile.extract +tarfile.TarFile.extractall +tarfile.TarFile.extraction_filter +tarfile.TarInfo.replace +tarfile.__all__ +tarfile.data_filter +tarfile.fully_trusted_filter +tarfile.tar_filter +tempfile.NamedTemporaryFile +token.EXCLAMATION +token.FSTRING_END +token.FSTRING_MIDDLE +token.FSTRING_START +token.__all__ +tokenize.EXCLAMATION +tokenize.FSTRING_END +tokenize.FSTRING_MIDDLE +tokenize.FSTRING_START +tokenize.__all__ +tty.__all__ +tty.cfmakecbreak +tty.cfmakeraw +turtle.RawTurtle.teleport +turtle.TNavigator.teleport +turtle.TPen.teleport +turtle.__all__ +turtle.teleport +types.AsyncGeneratorType.ag_suspended +typing.ParamSpec.__mro_entries__ +typing.ParamSpecArgs.__mro_entries__ +typing.ParamSpecKwargs.__mro_entries__ +typing.SupportsAbs.__type_params__ +typing.SupportsRound.__type_params__ +typing.TypeVar.__mro_entries__ +typing.TypeVarTuple.__mro_entries__ +typing._ProtocolMeta.__init__ +typing.__all__ +typing.override +typing_extensions.Protocol +typing_extensions.SupportsAbs.__type_params__ +typing_extensions.SupportsRound.__type_params__ +unittest.TestLoader.loadTestsFromModule +unittest.TestProgram.__init__ +unittest.TestResult.addDuration +unittest.TextTestResult.__init__ +unittest.TextTestRunner.__init__ +unittest.load_tests +unittest.loader.TestLoader.loadTestsFromModule +unittest.main.TestProgram.__init__ +unittest.mock.NonCallableMock.__new__ +unittest.result.TestResult.addDuration +unittest.runner.TextTestResult.__init__ +unittest.runner.TextTestRunner.__init__ +urllib.request.AbstractHTTPHandler.__init__ +urllib.request.HTTPSHandler.__init__ +uuid.main +webbrowser.Galeon +webbrowser.Grail +xxlimited.Xxo.x_exports +zipfile.Path.glob +zipfile.Path.is_symlink +zipfile.Path.match +zipfile.Path.relative_to +zipfile.Path.rglob +zoneinfo.ZoneInfo.from_file + +# Errors that also existed on Python 3.11 +_collections_abc.AsyncGenerator.ag_await +_collections_abc.AsyncGenerator.ag_code +_collections_abc.AsyncGenerator.ag_frame +_collections_abc.AsyncGenerator.ag_running +_collections_abc.AsyncIterable.__class_getitem__ +_collections_abc.Awaitable.__class_getitem__ +_collections_abc.Container.__class_getitem__ +_collections_abc.ItemsView.__reversed__ +_collections_abc.Iterable.__class_getitem__ +_collections_abc.KeysView.__reversed__ +_collections_abc.MappingView.__class_getitem__ +_collections_abc.ValuesView.__reversed__ +_csv.Reader +_csv.Writer +argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group +configparser.LegacyInterpolation.__init__ +enum.Enum.__init__ +# TODO: The stub for enum.auto is nothing like the implementation +enum.auto.__init__ +enum.auto.value +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +ftplib.FTP.trust_server_pasv_ipv4_address +functools.cached_property.__set__ # Stub is a white lie; see comments in the stub +functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically +ipaddress.IPv4Interface.hostmask +ipaddress.IPv6Interface.hostmask +ipaddress._BaseNetwork.broadcast_address +ipaddress._BaseNetwork.hostmask +multiprocessing.managers.SharedMemoryServer.create +multiprocessing.managers.SharedMemoryServer.list_segments +multiprocessing.managers.SharedMemoryServer.public +multiprocessing.managers.SharedMemoryServer.release_segment +multiprocessing.managers.SharedMemoryServer.shutdown +multiprocessing.managers.SharedMemoryServer.track_segment +multiprocessing.spawn._main +# platform.uname_result's processor field is now dynamically made to exist +platform.uname_result.__match_args__ +platform.uname_result.__new__ +platform.uname_result.processor +queue.SimpleQueue.__init__ +sys.UnraisableHookArgs # Not exported from sys +tkinter._VersionInfoType.__doc__ +typing.NewType.__call__ +typing.NewType.__mro_entries__ +weakref.WeakValueDictionary.update + +# Runtime has *args, **kwargs, but will error if any are supplied +unittest.TestCase.__init_subclass__ +unittest.case.TestCase.__init_subclass__ + +# ========== +# Related to positional-only arguments +# ========== + +# These are not positional-only at runtime, but we treat them +# as positional-only to match dict. +_collections_abc.MutableMapping.pop +_collections_abc.MutableMapping.setdefault + +# typing.IO uses positional-or-keyword arguments, but in the stubs we prefer +# to mark these as positional-only for compatibility with existing sub-classes. +typing.BinaryIO.write +typing.IO.read +typing.IO.readline +typing.IO.readlines +typing.IO.seek +typing.IO.truncate +typing.IO.write +typing.IO.writelines + +# positional-only complaints caused by differences between typing aliases and the "real" classes in the stdlib +_collections_abc.Coroutine.send +_collections_abc.Coroutine.throw +_collections_abc.Generator.send +_collections_abc.Generator.throw + +# typing.SupportsRound.__round__ # pos-or-kw at runtime, but we pretend it's pos-only in the stub so that e.g. float.__round__ satisfies the interface +types.DynamicClassAttribute..* # In the stub we pretend it's an alias for property, but it has positional-only differences + +# These three have a pos-or-keyword first parameter at runtime, but deliberately have a pos-only first parameter in the stub. #6812 +posixpath.join +ntpath.join +os.path.join + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. +_weakref.ProxyType.__reversed__ # Doesn't really exist +builtins.property.__set_name__ # Doesn't actually exist +hmac.new # Stub is a white lie; see comments in the stub +http.HTTPMethod.description # mutable instance attribute at runtime but we pretend it's a property +pickle.Pickler.reducer_override # implemented in C pickler +types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 +types.GenericAlias.__getattr__ +types.GenericAlias.__mro_entries__ +weakref.ProxyType.__reversed__ # Doesn't really exist +inspect._ParameterKind.description # Still exists, but stubtest can't see it +asyncio.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them +asyncio.base_events.BaseEventLoop.subprocess_exec # BaseEventLoop adds several parameters and stubtest fails on the difference if we add them + +# C signature is broader than what is actually accepted +ast.Bytes.__new__ +ast.Ellipsis.__new__ +ast.ExtSlice.__new__ +ast.Index.__new__ +ast.NameConstant.__new__ +ast.Num.__new__ +ast.Str.__new__ +asyncio.futures.Future.__init__ +asyncio.Future.__init__ +contextvars.Context.__init__ +queue.SimpleQueue.__init__ +xml.etree.ElementTree.XMLParser.__init__ +xml.etree.cElementTree.XMLParser.__init__ + +os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem +types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime +_ast.ImportFrom.level # None on the class, but never None on instances +ast.ImportFrom.level # None on the class, but never None on instances + +# Treated an alias of a typing class in the stubs, +# they are generic to type checkers anyway. +contextlib.AbstractAsyncContextManager.__class_getitem__ +contextlib.AbstractContextManager.__class_getitem__ + +# Super-special typing primitives +typing\._SpecialForm.* +typing._TypedDict.__delitem__ +typing._TypedDict.__ior__ +typing._TypedDict.__or__ +typing._TypedDict.copy +typing._TypedDict.items +typing._TypedDict.keys +typing._TypedDict.pop +typing._TypedDict.setdefault +typing._TypedDict.update +typing._TypedDict.values +typing_extensions\.Final +typing\.NamedTuple +typing\.LiteralString +typing\.Annotated + +# White lies around defaults +dataclasses.KW_ONLY diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index e733945113f4..bbb087eb788e 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -160,3 +160,9 @@ typing_extensions\.reveal_type # Doesn't exist at runtime typing\.Protocol + +# Removed in 3.12 +distutils\..* +asyncore.dispatcher.addr +asyncore.dispatcher.handle_accepted +asynchat.find_prefix_at_end diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 2d23e4570577..30a3f2b82a84 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -178,3 +178,9 @@ typing_extensions\.reveal_type # Super-special typing primitives typing_extensions\.Final + +# Removed in 3.12 +distutils\..* +asyncore.dispatcher.addr +asyncore.dispatcher.handle_accepted +asynchat.find_prefix_at_end diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index d5f5aa170543..769e2bf0315d 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -176,3 +176,9 @@ typing_extensions\.reveal_type typing_extensions\.Final typing\.NamedTuple typing\.Annotated + +# Removed in 3.12 +distutils\..* +asyncore.dispatcher.addr +asyncore.dispatcher.handle_accepted +asynchat.find_prefix_at_end diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 158f84d1509b..1391a3cef45d 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -33,9 +33,6 @@ _weakref.ReferenceType.__call__ # C function default annotation is wrong _weakref.ReferenceType.__init__ # Runtime defines __new__ but stubtest thinks __init__ is also defined. argparse.ArgumentParser.__init__ # stubtest doesn't recognise the runtime default (a class) as being compatible with a callback protocol (the stub annotation) argparse.Namespace.__getattr__ # The whole point of this class is its attributes are dynamic -asynchat.async_chat.encoding # Removal planned for 3.12, can add if someone needs this -asynchat.async_chat.use_encoding # Removal planned for 3.12, can add if someone needs this -asynchat.find_prefix_at_end # Removal planned for 3.12, can add if someone needs this # Condition functions are exported in __init__ asyncio.Condition.acquire asyncio.Condition.locked @@ -87,11 +84,6 @@ ctypes.memmove # CFunctionType ctypes.memset # CFunctionType ctypes.string_at # docstring argument name is wrong ctypes.wstring_at # docstring argument name is wrong -distutils.core.Distribution.get_command_obj # 1 used for True -distutils.command.bdist_packager # It exists in docs as package name but not in code except as a mention in a comment. -distutils.dist.Distribution.get_command_obj # 1 used for True -distutils.version.Version._cmp # class should have declared this -distutils.version.Version.parse # class should have declared this enum.Enum._generate_next_value_ hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime @@ -400,7 +392,6 @@ ssl.PROTOCOL_SSLv3 ssl.RAND_egd collections.abc.* # Types are re-exported from _collections_abc, so errors should be fixed there -distutils.command.check.SilentReporter # only defined if docutils in installed hmac.HMAC.blocksize # use block_size instead pickle.Pickler.memo # undocumented implementation detail, has different type in C/Python implementations pickle.Unpickler.memo # undocumented implementation detail, has different type in C/Python implementations @@ -533,24 +524,6 @@ turtle.ScrolledCanvas.select_item xml.dom.minidom.StringTypes # __all__-related weirdness (see #6523) -distutils.command.build -distutils.command.build_py -distutils.command.build_ext -distutils.command.build_clib -distutils.command.build_scripts -distutils.command.clean -distutils.command.install -distutils.command.install_lib -distutils.command.install_headers -distutils.command.install_scripts -distutils.command.install_data -distutils.command.sdist -distutils.command.register -distutils.command.bdist -distutils.command.bdist_dumb -distutils.command.bdist_rpm -distutils.command.check -distutils.command.upload email.base64mime email.charset email.encoders @@ -568,29 +541,6 @@ xml.dom xml.etree xml.sax -# Dynamically created -distutils.(dist|core).Distribution.get_name -distutils.(dist|core).Distribution.get_version -distutils.(dist|core).Distribution.get_fullname -distutils.(dist|core).Distribution.get_author -distutils.(dist|core).Distribution.get_author_email -distutils.(dist|core).Distribution.get_maintainer -distutils.(dist|core).Distribution.get_maintainer_email -distutils.(dist|core).Distribution.get_contact -distutils.(dist|core).Distribution.get_contact_email -distutils.(dist|core).Distribution.get_url -distutils.(dist|core).Distribution.get_license -distutils.(dist|core).Distribution.get_licence -distutils.(dist|core).Distribution.get_description -distutils.(dist|core).Distribution.get_long_description -distutils.(dist|core).Distribution.get_keywords -distutils.(dist|core).Distribution.get_platforms -distutils.(dist|core).Distribution.get_classifiers -distutils.(dist|core).Distribution.get_download_url -distutils.(dist|core).Distribution.get_requires -distutils.(dist|core).Distribution.get_provides -distutils.(dist|core).Distribution.get_obsoletes - # Platform differences that cannot be captured by the type system os.O_[A-Z_]+ socket.AF_DECnet @@ -677,97 +627,6 @@ _collections_abc.ByteString # Any of these can be added if someone needs them # ========== -# Removal planned for 3.12 -asyncore.dispatcher.addr -asyncore.dispatcher.handle_accepted -# Missing from distutils module (deprecated, to be removed in 3.12) -distutils.archive_util.ARCHIVE_FORMATS -distutils.archive_util.check_archive_formats -distutils.bcppcompiler.BCPPCompiler.compiler_type -distutils.bcppcompiler.BCPPCompiler.exe_extension -distutils.bcppcompiler.BCPPCompiler.executables -distutils.bcppcompiler.BCPPCompiler.obj_extension -distutils.bcppcompiler.BCPPCompiler.shared_lib_extension -distutils.bcppcompiler.BCPPCompiler.shared_lib_format -distutils.bcppcompiler.BCPPCompiler.src_extensions -distutils.bcppcompiler.BCPPCompiler.static_lib_extension -distutils.bcppcompiler.BCPPCompiler.static_lib_format -distutils.ccompiler.CCompiler.EXECUTABLE -distutils.ccompiler.CCompiler.SHARED_LIBRARY -distutils.ccompiler.CCompiler.SHARED_OBJECT -distutils.ccompiler.CCompiler.compiler_type -distutils.ccompiler.CCompiler.exe_extension -distutils.ccompiler.CCompiler.language_map -distutils.ccompiler.CCompiler.language_order -distutils.ccompiler.CCompiler.obj_extension -distutils.ccompiler.CCompiler.set_executable -distutils.ccompiler.CCompiler.shared_lib_extension -distutils.ccompiler.CCompiler.shared_lib_format -distutils.ccompiler.CCompiler.src_extensions -distutils.ccompiler.CCompiler.static_lib_extension -distutils.ccompiler.CCompiler.static_lib_format -distutils.ccompiler.compiler_class -distutils.command.bdist -distutils.command.install.* -distutils.cygwinccompiler.CygwinCCompiler.compiler_type -distutils.cygwinccompiler.CygwinCCompiler.exe_extension -distutils.cygwinccompiler.CygwinCCompiler.obj_extension -distutils.cygwinccompiler.CygwinCCompiler.shared_lib_extension -distutils.cygwinccompiler.CygwinCCompiler.shared_lib_format -distutils.cygwinccompiler.CygwinCCompiler.static_lib_extension -distutils.cygwinccompiler.CygwinCCompiler.static_lib_format -distutils.cygwinccompiler.Mingw32CCompiler.compiler_type -distutils.dir_util.ensure_relative -distutils.dist.DistributionMetadata.set_classifiers -distutils.dist.DistributionMetadata.set_keywords -distutils.dist.DistributionMetadata.set_platforms -distutils.dist.fix_help_options -distutils.extension.read_setup_file -distutils.fancy_getopt.FancyGetopt.add_option -distutils.fancy_getopt.FancyGetopt.get_attr_name -distutils.fancy_getopt.FancyGetopt.has_option -distutils.fancy_getopt.FancyGetopt.print_help -distutils.fancy_getopt.FancyGetopt.set_aliases -distutils.fancy_getopt.FancyGetopt.set_negative_aliases -distutils.fancy_getopt.FancyGetopt.set_option_table -distutils.msvccompiler.MSVCCompiler.compiler_type -distutils.msvccompiler.MSVCCompiler.exe_extension -distutils.msvccompiler.MSVCCompiler.executables -distutils.msvccompiler.MSVCCompiler.find_exe -distutils.msvccompiler.MSVCCompiler.initialize -distutils.msvccompiler.MSVCCompiler.obj_extension -distutils.msvccompiler.MSVCCompiler.res_extension -distutils.msvccompiler.MSVCCompiler.shared_lib_extension -distutils.msvccompiler.MSVCCompiler.shared_lib_format -distutils.msvccompiler.MSVCCompiler.src_extensions -distutils.msvccompiler.MSVCCompiler.static_lib_extension -distutils.msvccompiler.MSVCCompiler.static_lib_format -distutils.msvccompiler.convert_mbcs -distutils.msvccompiler.get_build_architecture -distutils.msvccompiler.get_build_version -distutils.msvccompiler.normalize_and_reduce_paths -distutils.msvccompiler.read_keys -distutils.msvccompiler.read_values -distutils.sysconfig.build_flags -distutils.sysconfig.parse_config_h -distutils.sysconfig.parse_makefile -distutils.text_file.TextFile.default_options -distutils.text_file.TextFile.error -distutils.text_file.TextFile.gen_error -distutils.unixccompiler.UnixCCompiler.compiler_type -distutils.unixccompiler.UnixCCompiler.dylib_lib_extension -distutils.unixccompiler.UnixCCompiler.dylib_lib_format -distutils.unixccompiler.UnixCCompiler.executables -distutils.unixccompiler.UnixCCompiler.obj_extension -distutils.unixccompiler.UnixCCompiler.shared_lib_extension -distutils.unixccompiler.UnixCCompiler.shared_lib_format -distutils.unixccompiler.UnixCCompiler.src_extensions -distutils.unixccompiler.UnixCCompiler.static_lib_extension -distutils.unixccompiler.UnixCCompiler.static_lib_format -distutils.unixccompiler.UnixCCompiler.xcode_stub_lib_extension -distutils.unixccompiler.UnixCCompiler.xcode_stub_lib_format -distutils.util.grok_environment_error - # Missing from pkgutil.ImpImporter/ImpLoader (both deprecated since 3.3, can add if someone needs it) pkgutil.ImpImporter.find_module pkgutil.ImpImporter.iter_modules diff --git a/tests/stubtest_allowlists/win32-py310.txt b/tests/stubtest_allowlists/win32-py310.txt index 264c489625c7..9999729feae6 100644 --- a/tests/stubtest_allowlists/win32-py310.txt +++ b/tests/stubtest_allowlists/win32-py310.txt @@ -9,3 +9,7 @@ asyncio.windows_events.IocpProactor.recvfrom asyncio.windows_events.IocpProactor.sendto msvcrt.GetErrorMode subprocess.STARTUPINFO.copy + +# pathlib methods that exist on Windows, but always raise NotImplementedError, +# so are omitted from the stub +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32-py311.txt b/tests/stubtest_allowlists/win32-py311.txt index bfda0e031438..6a4bb0a3a451 100644 --- a/tests/stubtest_allowlists/win32-py311.txt +++ b/tests/stubtest_allowlists/win32-py311.txt @@ -12,3 +12,7 @@ asyncio.windows_events.IocpProactor.sendto msvcrt.GetErrorMode os.EX_OK subprocess.STARTUPINFO.copy + +# pathlib methods that exist on Windows, but always raise NotImplementedError, +# so are omitted from the stub +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32-py312.txt b/tests/stubtest_allowlists/win32-py312.txt new file mode 100644 index 000000000000..bfda0e031438 --- /dev/null +++ b/tests/stubtest_allowlists/win32-py312.txt @@ -0,0 +1,14 @@ + +_winapi.CreateFileMapping +_winapi.MapViewOfFile +_winapi.OpenFileMapping +_winapi.VirtualQuerySize +asyncio.IocpProactor.recvfrom +asyncio.IocpProactor.recvfrom_into +asyncio.IocpProactor.sendto +asyncio.windows_events.IocpProactor.recvfrom +asyncio.windows_events.IocpProactor.recvfrom_into +asyncio.windows_events.IocpProactor.sendto +msvcrt.GetErrorMode +os.EX_OK +subprocess.STARTUPINFO.copy diff --git a/tests/stubtest_allowlists/win32-py37.txt b/tests/stubtest_allowlists/win32-py37.txt index bc15d7168b4b..e806f8fa45a3 100644 --- a/tests/stubtest_allowlists/win32-py37.txt +++ b/tests/stubtest_allowlists/win32-py37.txt @@ -16,3 +16,4 @@ urllib.parse.parse_qsl # so are omitted from the stub pathlib.WindowsPath.group pathlib.WindowsPath.owner +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32-py38.txt b/tests/stubtest_allowlists/win32-py38.txt index 91ec59264252..44d8c508eb3d 100644 --- a/tests/stubtest_allowlists/win32-py38.txt +++ b/tests/stubtest_allowlists/win32-py38.txt @@ -17,3 +17,4 @@ subprocess.STARTUPINFO.copy # so are omitted from the stub pathlib.WindowsPath.group pathlib.WindowsPath.owner +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32-py39.txt b/tests/stubtest_allowlists/win32-py39.txt index c5756562a5d0..5af02679e126 100644 --- a/tests/stubtest_allowlists/win32-py39.txt +++ b/tests/stubtest_allowlists/win32-py39.txt @@ -8,3 +8,7 @@ asyncio.IocpProactor.sendto asyncio.windows_events.IocpProactor.recvfrom asyncio.windows_events.IocpProactor.sendto subprocess.STARTUPINFO.copy + +# pathlib methods that exist on Windows, but always raise NotImplementedError, +# so are omitted from the stub +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index 2404b2bce6df..7e68abf51531 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -1,5 +1,4 @@ ctypes.GetLastError # Is actually a pointer -distutils.msvccompiler.HKEYS locale.[A-Z0-9_]+ # Constants that should be moved to _locale and re-exported conditionally locale.nl_langinfo # Function that should be moved to _locale and re-exported conditionally mmap.PAGESIZE @@ -15,9 +14,6 @@ winsound.SND_APPLICATION # Exists at runtime, but missing from stubs _msi.MSIError -distutils.msvccompiler.MSVCCompiler.manifest_get_embed_info -distutils.msvccompiler.MSVCCompiler.manifest_setup_ldargs -distutils.msvccompiler.OldMSVCCompiler msvcrt.SetErrorMode ssl.SSLSocket.recvmsg ssl.SSLSocket.recvmsg_into @@ -73,4 +69,3 @@ pathlib.Path.group # pathlib methods that exist on Windows, but always raise NotImplementedError, # so are omitted from the stub pathlib.Path.is_mount -pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_stdlib.py b/tests/stubtest_stdlib.py index 496e28a3745a..ebe49876c82b 100755 --- a/tests/stubtest_stdlib.py +++ b/tests/stubtest_stdlib.py @@ -57,6 +57,7 @@ def run_stubtest(typeshed_dir: Path) -> int: str(allowlist_dir / "py3_common.txt"), "--allowlist", str(allowlist_dir / version_allowlist), + "--generate-allowlist", ] if (allowlist_dir / platform_allowlist).exists(): cmd += ["--allowlist", str(allowlist_dir / platform_allowlist)] From 89a97e9ba0f65cd737980f2527c2f78135251f68 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:18:37 -0700 Subject: [PATCH 02/10] more --- tests/stubtest_allowlists/darwin-py310.txt | 2 -- tests/stubtest_allowlists/darwin-py37.txt | 1 - tests/stubtest_allowlists/darwin-py38.txt | 5 ---- tests/stubtest_allowlists/darwin-py39.txt | 5 ---- tests/stubtest_allowlists/linux-py310.txt | 2 -- tests/stubtest_allowlists/linux-py37.txt | 1 - tests/stubtest_allowlists/linux-py38.txt | 2 -- tests/stubtest_allowlists/linux-py39.txt | 2 -- tests/stubtest_allowlists/py310.txt | 10 ++++++++ tests/stubtest_allowlists/py311.txt | 10 ++++++++ tests/stubtest_allowlists/py312.txt | 27 ---------------------- tests/stubtest_allowlists/py37.txt | 11 ++++++++- tests/stubtest_allowlists/py38.txt | 11 ++++++++- tests/stubtest_allowlists/py39.txt | 11 ++++++++- tests/stubtest_allowlists/py3_common.txt | 11 --------- 15 files changed, 50 insertions(+), 61 deletions(-) delete mode 100644 tests/stubtest_allowlists/darwin-py38.txt delete mode 100644 tests/stubtest_allowlists/darwin-py39.txt diff --git a/tests/stubtest_allowlists/darwin-py310.txt b/tests/stubtest_allowlists/darwin-py310.txt index 23992673ae8f..59db7d8e31f3 100644 --- a/tests/stubtest_allowlists/darwin-py310.txt +++ b/tests/stubtest_allowlists/darwin-py310.txt @@ -11,5 +11,3 @@ _?curses.color_pair # ========== # Allowlist entries that cannot or should not be fixed # ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/darwin-py37.txt b/tests/stubtest_allowlists/darwin-py37.txt index e300b9f1626a..1237f3ac9f0d 100644 --- a/tests/stubtest_allowlists/darwin-py37.txt +++ b/tests/stubtest_allowlists/darwin-py37.txt @@ -5,5 +5,4 @@ pwd.getpwnam # Allowlist entries that cannot or should not be fixed # ========== -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 diff --git a/tests/stubtest_allowlists/darwin-py38.txt b/tests/stubtest_allowlists/darwin-py38.txt deleted file mode 100644 index eefb793f8093..000000000000 --- a/tests/stubtest_allowlists/darwin-py38.txt +++ /dev/null @@ -1,5 +0,0 @@ -# ========== -# Allowlist entries that cannot or should not be fixed -# ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/darwin-py39.txt b/tests/stubtest_allowlists/darwin-py39.txt deleted file mode 100644 index eefb793f8093..000000000000 --- a/tests/stubtest_allowlists/darwin-py39.txt +++ /dev/null @@ -1,5 +0,0 @@ -# ========== -# Allowlist entries that cannot or should not be fixed -# ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/linux-py310.txt b/tests/stubtest_allowlists/linux-py310.txt index 541a04ed3d25..77058e51ed27 100644 --- a/tests/stubtest_allowlists/linux-py310.txt +++ b/tests/stubtest_allowlists/linux-py310.txt @@ -18,5 +18,3 @@ signal.sigwaitinfo # ========== # Allowlist entries that cannot or should not be fixed # ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/linux-py37.txt b/tests/stubtest_allowlists/linux-py37.txt index e300b9f1626a..1237f3ac9f0d 100644 --- a/tests/stubtest_allowlists/linux-py37.txt +++ b/tests/stubtest_allowlists/linux-py37.txt @@ -5,5 +5,4 @@ pwd.getpwnam # Allowlist entries that cannot or should not be fixed # ========== -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 diff --git a/tests/stubtest_allowlists/linux-py38.txt b/tests/stubtest_allowlists/linux-py38.txt index e13cc7b14f2e..b81a540ec908 100644 --- a/tests/stubtest_allowlists/linux-py38.txt +++ b/tests/stubtest_allowlists/linux-py38.txt @@ -3,5 +3,3 @@ select.epoll.register # ========== # Allowlist entries that cannot or should not be fixed # ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/linux-py39.txt b/tests/stubtest_allowlists/linux-py39.txt index 65371563b12f..0002c91df04a 100644 --- a/tests/stubtest_allowlists/linux-py39.txt +++ b/tests/stubtest_allowlists/linux-py39.txt @@ -4,5 +4,3 @@ select.epoll.register # ========== # Allowlist entries that cannot or should not be fixed # ========== - -distutils.command.bdist_msi # Only available on Windows and Python 3.10 and below diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 22ace9d96e4c..005d746d018d 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -13,14 +13,18 @@ asyncio.Future.__init__ # Usually initialized from c object asyncio.futures.Future.__init__ # Usually initialized from c object builtins.float.__setformat__ # Internal method for CPython test suite builtins.property.__set_name__ # Doesn't actually exist +bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set +configparser.ParsingError.filename contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ +enum.Enum._generate_next_value_ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve functools.cached_property.__set__ # Stub is a white lie; see comments in the stub functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically gettext.install gettext.translation hmac.new # Stub is a white lie; see comments in the stub +importlib.abc.Finder.find_module importlib.metadata._meta.SimplePath.__truediv__ # See comments in the stub ipaddress.IPv4Interface.hostmask ipaddress.IPv6Interface.hostmask @@ -51,6 +55,12 @@ typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ + # Runtime has *args, **kwargs, but will error if any are supplied unittest.TestCase.__init_subclass__ unittest.case.TestCase.__init_subclass__ diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 22adf3df1f4b..b3ee7514c1b9 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -13,7 +13,10 @@ _collections_abc.ValuesView.__reversed__ _csv.Reader _csv.Writer argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group +bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set configparser.LegacyInterpolation.__init__ +configparser.ParsingError.filename +enum.Enum._generate_next_value_ enum.Enum.__init__ # TODO: The stub for enum.auto is nothing like the implementation enum.auto.__init__ @@ -22,6 +25,7 @@ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolv ftplib.FTP.trust_server_pasv_ipv4_address functools.cached_property.__set__ # Stub is a white lie; see comments in the stub functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically +importlib.abc.Finder.find_module ipaddress.IPv4Interface.hostmask ipaddress.IPv6Interface.hostmask ipaddress._BaseNetwork.broadcast_address @@ -48,6 +52,12 @@ weakref.WeakValueDictionary.update unittest.TestCase.__init_subclass__ unittest.case.TestCase.__init_subclass__ +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ + # ========== # Related to positional-only arguments # ========== diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index a49d9ff81e05..e4c212e3c09b 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -47,33 +47,6 @@ dis.__all__ dis.hasarg dis.hasexc dis.hasnargs -distutils -distutils.archive_util -distutils.bcppcompiler -distutils.ccompiler -distutils.cmd -distutils.command -distutils.command.config -distutils.config -distutils.core -distutils.cygwinccompiler -distutils.debug -distutils.dep_util -distutils.dir_util -distutils.dist -distutils.errors -distutils.extension -distutils.fancy_getopt -distutils.file_util -distutils.filelist -distutils.log -distutils.msvccompiler -distutils.spawn -distutils.sysconfig -distutils.text_file -distutils.unixccompiler -distutils.util -distutils.version email.utils.localtime enum.Enum.__signature__ enum.EnumMeta.__call__ diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index bbb087eb788e..c4f331a5e282 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -14,6 +14,7 @@ asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclass builtins.float.__set_format__ # Internal method for CPython test suite builtins.str.maketrans builtins.input # Incorrect default value in text signature, fixed in 3.10 +bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set cmath.log collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491 @@ -26,13 +27,15 @@ collections.AsyncGenerator.ag_running collections.ByteString # see comments in py3_common.txt collections.Callable collections.Mapping.__reversed__ # Set to None at runtime for a better error message +configparser.ParsingError.filename contextvars.ContextVar.get -distutils.command.bdist_wininst # see #6523 dummy_threading.Condition.acquire dummy_threading.Condition.release dummy_threading.Event.isSet dummy_threading.local.__new__ +enum.Enum._generate_next_value_ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve +importlib.abc.Finder.find_module inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this inspect.Signature.from_function # Removed in 3.11, can add if someone needs this ipaddress._BaseNetwork.__init__ @@ -50,6 +53,12 @@ uuid.UUID.is_safe xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 xml.etree.cElementTree.TreeBuilder.start # bpo-39495 +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ + collections.Coroutine.cr_await collections.Coroutine.cr_code collections.Coroutine.cr_frame diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 30a3f2b82a84..ca09e883c500 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -21,6 +21,7 @@ asyncio.transports.WriteTransport.get_write_buffer_limits # Documented. Exists asyncio.WriteTransport.get_write_buffer_limits # Documented. Exists in subclasses, but not in WriteTransport itself builtins.float.__set_format__ # Internal method for CPython test suite builtins.input # Incorrect default value in text signature, fixed in 3.10 +bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491 collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491 @@ -35,18 +36,20 @@ collections.ItemsView.__reversed__ collections.KeysView.__reversed__ collections.ValuesView.__reversed__ collections.Mapping.__reversed__ # Set to None at runtime for a better error message -distutils.command.bdist_wininst # see #6523 +configparser.ParsingError.filename dummy_threading.Condition.acquire dummy_threading.Condition.release dummy_threading.Event.isSet dummy_threading.Thread.native_id dummy_threading.local.__new__ +enum.Enum._generate_next_value_ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 functools.cached_property.__set__ # Stub is a white lie; see comments in the stub gettext.install # codeset default value is ['unspecified'] so can't be specified gettext.translation # codeset default value is ['unspecified'] so can't be specified hmac.new # Stub is a white lie; see comments in the stub +importlib.abc.Finder.find_module inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this inspect.Signature.from_function # Removed in 3.11, can add if someone needs this ipaddress.IPv4Interface.hostmask @@ -69,6 +72,12 @@ xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signatur xml.etree.cElementTree.TreeBuilder.start # bpo-39495 xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ + collections.Coroutine.cr_await collections.Coroutine.cr_code collections.Coroutine.cr_frame diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 769e2bf0315d..5f50bc25fbeb 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -19,6 +19,7 @@ asyncio.Future.__init__ # Usually initialized from c object asyncio.futures.Future.__init__ # Usually initialized from c object builtins.float.__setformat__ # Internal method for CPython test suite builtins.input # Incorrect default value in text signature, fixed in 3.10 +bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set collections.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. collections.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491 collections.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491 @@ -33,15 +34,17 @@ collections.Mapping.__reversed__ # Set to None at runtime for a better error me collections.ItemsView.__reversed__ collections.KeysView.__reversed__ collections.ValuesView.__reversed__ +configparser.ParsingError.filename contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ -distutils.command.bdist_wininst # see #6523 +enum.Enum._generate_next_value_ fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve functools.cached_property.__set__ # Stub is a white lie; see comments in the stub functools._lru_cache_wrapper.cache_parameters # Cannot be detected statically gettext.install gettext.translation hmac.new # Stub is a white lie; see comments in the stub +importlib.abc.Finder.find_module inspect.Signature.from_builtin # Removed in 3.11, can add if someone needs this inspect.Signature.from_function # Removed in 3.11, can add if someone needs this ipaddress.IPv4Interface.hostmask @@ -73,6 +76,12 @@ typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update +# Exist at runtime for internal reasons, no need to put them in the stub +typing_extensions\.TypeAliasType\.__call__ +typing_extensions\.TypeAliasType\.__init_subclass__ +# We call them read-only properties, runtime implementation is slightly different +typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ + collections.Coroutine.cr_await collections.Coroutine.cr_code collections.Coroutine.cr_frame diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 1391a3cef45d..371b343686d9 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -50,7 +50,6 @@ builtins.function builtins.memoryview.__contains__ # C type that implements __getitem__ builtins.object.__init__ # default C signature is incorrect builtins.type.__dict__ # read-only but not actually a property; stubtest thinks it's a mutable attribute. -bz2.BZ2Decompressor.__init__ # function does not accept parameters but C signature is set # The following CodecInfo properties are added in __new__ codecs.CodecInfo.decode codecs.CodecInfo.encode @@ -84,7 +83,6 @@ ctypes.memmove # CFunctionType ctypes.memset # CFunctionType ctypes.string_at # docstring argument name is wrong ctypes.wstring_at # docstring argument name is wrong -enum.Enum._generate_next_value_ hashlib.sha3_\d+ # Can be a class or a built-in function, can't be subclassed at runtime hashlib.shake_\d+ # Can be a class or a built-in function, can't be subclassed at runtime http.HTTPStatus.description # set in __new__ @@ -231,13 +229,11 @@ bz2.BZ2File.peek codecs.StreamReader.charbuffertype codecs.StreamReader.seek codecs.StreamWriter.seek -configparser.ParsingError.filename configparser.RawConfigParser.converters ctypes.ARRAY ctypes.SetPointerType ctypes.c_voidp ctypes.util.test -importlib.abc.Finder.find_module lib2to3.pgen2.grammar.Grammar.loads mimetypes.MimeTypes.add_type modulefinder.test @@ -450,15 +446,8 @@ typing\.AbstractSet .*\.__protocol_attrs__ .*\.__callable_proto_members_only__ -# Exist at runtime for internal reasons, no need to put them in the stub -typing_extensions\.TypeAliasType\.__call__ -typing_extensions\.TypeAliasType\.__init_subclass__ - typing_extensions.NewType.__mro_entries__ # just exists for an error message -# We call them read-only properties, runtime implementation is slightly different -typing_extensions\.TypeAliasType\.__(parameters|type_params|name|module|value)__ - # https://github.com/python/mypy/issues/15302 typing_extensions.NewType.__call__ typing_extensions\.deprecated From d8b3a15e84399218a7712c64fd82e977af4662c2 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:23:26 -0700 Subject: [PATCH 03/10] more --- tests/stubtest_allowlists/py310.txt | 7 +++++++ tests/stubtest_allowlists/py311.txt | 6 ++++++ tests/stubtest_allowlists/py37.txt | 6 ++++++ tests/stubtest_allowlists/py38.txt | 7 +++++++ tests/stubtest_allowlists/py39.txt | 6 ++++++ tests/stubtest_allowlists/py3_common.txt | 21 --------------------- 6 files changed, 32 insertions(+), 21 deletions(-) diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 005d746d018d..11df20b1665f 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -194,8 +194,15 @@ typing_extensions\.Final typing\.NamedTuple typing\.Annotated +# We lie about the existence of these methods +.*.__buffer__ +.*.__release_buffer__ + + # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted asynchat.find_prefix_at_end +pkgutil.ImpImporter\..* +pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index b3ee7514c1b9..dbaa5849cb0b 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -160,8 +160,14 @@ typing.ParamSpec(Args|Kwargs).__origin__ typing\.TypeVar\.__.*__ typing\.ParamSpec\.__.*__ +# We lie about the existence of these methods +.*.__buffer__ +.*.__release_buffer__ + # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted asynchat.find_prefix_at_end +pkgutil.ImpImporter\..* +pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index c4f331a5e282..f2f155fcab39 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -170,8 +170,14 @@ typing_extensions\.reveal_type # Doesn't exist at runtime typing\.Protocol +# We lie about the existence of these methods +.*.__buffer__ +.*.__release_buffer__ + # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted asynchat.find_prefix_at_end +pkgutil.ImpImporter\..* +pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index ca09e883c500..318c89b12993 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -188,8 +188,15 @@ typing_extensions\.reveal_type # Super-special typing primitives typing_extensions\.Final +# We lie about the existence of these methods +.*.__buffer__ +.*.__release_buffer__ + + # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted asynchat.find_prefix_at_end +pkgutil.ImpImporter\..* +pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 5f50bc25fbeb..c5225803b743 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -186,8 +186,14 @@ typing_extensions\.Final typing\.NamedTuple typing\.Annotated +# We lie about the existence of these methods +.*.__buffer__ +.*.__release_buffer__ + # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted asynchat.find_prefix_at_end +pkgutil.ImpImporter\..* +pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index 371b343686d9..ec988f7989c0 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -610,24 +610,3 @@ typing.IO.__iter__ # See https://github.com/python/typeshed/commit/97bc450acd60 # As a side effect, this changes the definition of collections.abc.ByteString, which is okay, # because it's not an ABC that makes any sense and was deprecated in 3.12 _collections_abc.ByteString - -# ========== -# Missing from deprecated modules -# Any of these can be added if someone needs them -# ========== - -# Missing from pkgutil.ImpImporter/ImpLoader (both deprecated since 3.3, can add if someone needs it) -pkgutil.ImpImporter.find_module -pkgutil.ImpImporter.iter_modules -pkgutil.ImpLoader.code -pkgutil.ImpLoader.get_code -pkgutil.ImpLoader.get_data -pkgutil.ImpLoader.get_filename -pkgutil.ImpLoader.get_source -pkgutil.ImpLoader.is_package -pkgutil.ImpLoader.load_module -pkgutil.ImpLoader.source - -# We lie about the existence of these methods -.*.__buffer__ -.*.__release_buffer__ From 6824284ddac94c6b0284efef98e86767be6e1fa7 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:25:32 -0700 Subject: [PATCH 04/10] more --- tests/stubtest_allowlists/linux-py312.txt | 36 +++++++++++++++++ tests/stubtest_allowlists/py312.txt | 31 --------------- tests/stubtest_allowlists/win32-py312.txt | 47 +++++++++++++++++++++++ 3 files changed, 83 insertions(+), 31 deletions(-) create mode 100644 tests/stubtest_allowlists/linux-py312.txt diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt new file mode 100644 index 000000000000..43bc9608bb05 --- /dev/null +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -0,0 +1,36 @@ +_?curses.color_pair +mmap.MAP_STACK +(os|posix).CLONE_FILES +(os|posix).CLONE_FS +(os|posix).CLONE_NEWCGROUP +(os|posix).CLONE_NEWIPC +(os|posix).CLONE_NEWNET +(os|posix).CLONE_NEWNS +(os|posix).CLONE_NEWPID +(os|posix).CLONE_NEWUSER +(os|posix).CLONE_NEWUTS +(os|posix).CLONE_SIGHAND +(os|posix).CLONE_SYSVSEM +(os|posix).CLONE_THREAD +(os|posix).CLONE_VM +(os|posix).DirEntry.is_junction +(os|posix).EFD_CLOEXEC +(os|posix).EFD_NONBLOCK +(os|posix).EFD_SEMAPHORE +(os|posix).eventfd +(os|posix).eventfd_read +(os|posix).eventfd_write +(os|posix).sendfile +(os|posix).setns +(os|posix).setresgid +(os|posix).setresuid +(os|posix).splice +(os|posix).SPLICE_F_MORE +(os|posix).SPLICE_F_MOVE +(os|posix).SPLICE_F_NONBLOCK +(os|posix).unshare +signal.sigtimedwait +signal.sigwaitinfo +xxlimited.Xxo.x_exports +syslog.LOG_MASK +syslog.LOG_UPTO diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index e4c212e3c09b..87871ec9ad37 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -163,35 +163,6 @@ pkgutil.ImpImporter pkgutil.ImpLoader pkgutil.__all__ poplib.POP3_SSL.__init__ -posix.CLONE_FILES -posix.CLONE_FS -posix.CLONE_NEWCGROUP -posix.CLONE_NEWIPC -posix.CLONE_NEWNET -posix.CLONE_NEWNS -posix.CLONE_NEWPID -posix.CLONE_NEWUSER -posix.CLONE_NEWUTS -posix.CLONE_SIGHAND -posix.CLONE_SYSVSEM -posix.CLONE_THREAD -posix.CLONE_VM -posix.DirEntry.is_junction -posix.EFD_CLOEXEC -posix.EFD_NONBLOCK -posix.EFD_SEMAPHORE -posix.SPLICE_F_MORE -posix.SPLICE_F_MOVE -posix.SPLICE_F_NONBLOCK -posix.eventfd -posix.eventfd_read -posix.eventfd_write -posix.sendfile -posix.setns -posix.setresgid -posix.setresuid -posix.splice -posix.unshare posixpath.__all__ posixpath.isjunction posixpath.splitroot @@ -257,8 +228,6 @@ sys.activate_stack_trampoline sys.deactivate_stack_trampoline sys.getunicodeinternedsize sys.is_stack_trampoline_active -syslog.LOG_MASK -syslog.LOG_UPTO syslog.setlogmask tarfile.AbsoluteLinkError tarfile.AbsolutePathError diff --git a/tests/stubtest_allowlists/win32-py312.txt b/tests/stubtest_allowlists/win32-py312.txt index bfda0e031438..38cf282e4f16 100644 --- a/tests/stubtest_allowlists/win32-py312.txt +++ b/tests/stubtest_allowlists/win32-py312.txt @@ -1,14 +1,61 @@ +_socket.AF_HYPERV +_socket.HV_GUID_BROADCAST +_socket.HV_GUID_CHILDREN +_socket.HV_GUID_LOOPBACK +_socket.HV_GUID_PARENT +_socket.HV_GUID_WILDCARD +_socket.HV_GUID_ZERO +_socket.HV_PROTOCOL_RAW +_socket.HVSOCKET_ADDRESS_FLAG_PASSTHRU +_socket.HVSOCKET_CONNECT_TIMEOUT +_socket.HVSOCKET_CONNECT_TIMEOUT_MAX +_socket.HVSOCKET_CONNECTED_SUSPEND +_socket.IP_ADD_SOURCE_MEMBERSHIP +_socket.IP_BLOCK_SOURCE +_socket.IP_DROP_SOURCE_MEMBERSHIP +_socket.IP_PKTINFO +_socket.IP_UNBLOCK_SOURCE _winapi.CreateFileMapping _winapi.MapViewOfFile +_winapi.NeedCurrentDirectoryForExePath _winapi.OpenFileMapping _winapi.VirtualQuerySize +asyncio.IocpProactor.finish_socket_func asyncio.IocpProactor.recvfrom asyncio.IocpProactor.recvfrom_into asyncio.IocpProactor.sendto +asyncio.windows_events.IocpProactor.finish_socket_func asyncio.windows_events.IocpProactor.recvfrom asyncio.windows_events.IocpProactor.recvfrom_into asyncio.windows_events.IocpProactor.sendto msvcrt.GetErrorMode +ntpath.isdir os.EX_OK +os.get_blocking +os.listdrives +os.listmounts +os.listvolumes +os.path.isdir +os.set_blocking +os.stat_result.st_birthtime +os.stat_result.st_birthtime_ns +socket.AddressFamily.AF_HYPERV +socket.AF_HYPERV +socket.HV_GUID_BROADCAST +socket.HV_GUID_CHILDREN +socket.HV_GUID_LOOPBACK +socket.HV_GUID_PARENT +socket.HV_GUID_WILDCARD +socket.HV_GUID_ZERO +socket.HV_PROTOCOL_RAW +socket.HVSOCKET_ADDRESS_FLAG_PASSTHRU +socket.HVSOCKET_CONNECT_TIMEOUT +socket.HVSOCKET_CONNECT_TIMEOUT_MAX +socket.HVSOCKET_CONNECTED_SUSPEND +socket.IP_ADD_SOURCE_MEMBERSHIP +socket.IP_BLOCK_SOURCE +socket.IP_DROP_SOURCE_MEMBERSHIP +socket.IP_PKTINFO +socket.IP_UNBLOCK_SOURCE subprocess.STARTUPINFO.copy From 350393676518fe19d57f081f60eee7e2a3575a77 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:26:59 -0700 Subject: [PATCH 05/10] more --- tests/stubtest_allowlists/darwin-py312.txt | 2 ++ tests/stubtest_allowlists/linux-py312.txt | 2 ++ tests/stubtest_allowlists/py312.txt | 21 --------------------- 3 files changed, 4 insertions(+), 21 deletions(-) diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index 388f1d9b1600..bca57a758189 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -1,5 +1,7 @@ _?curses.color_pair xxlimited.Xxo.x_exports +fcntl.FICLONE +fcntl.FICLONERANGE # Exists at runtime, missing from stub socket.TCP_CONNECTION_INFO diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index 43bc9608bb05..bc054708cc25 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -1,5 +1,7 @@ _?curses.color_pair mmap.MAP_STACK +fcntl.FICLONE +fcntl.FICLONERANGE (os|posix).CLONE_FILES (os|posix).CLONE_FS (os|posix).CLONE_NEWCGROUP diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 87871ec9ad37..447667ccaec1 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -52,8 +52,6 @@ enum.Enum.__signature__ enum.EnumMeta.__call__ enum.EnumType.__call__ enum.property.member -fcntl.FICLONE -fcntl.FICLONERANGE ftplib.FTP_TLS.__init__ functools.WRAPPER_ASSIGNMENTS functools.update_wrapper @@ -116,26 +114,7 @@ opcode.__all__ opcode.hasarg opcode.hasexc opcode.hasnargs -os.CLONE_FILES -os.CLONE_FS -os.CLONE_NEWCGROUP -os.CLONE_NEWIPC -os.CLONE_NEWNET -os.CLONE_NEWNS -os.CLONE_NEWPID -os.CLONE_NEWUSER -os.CLONE_NEWUTS -os.CLONE_SIGHAND -os.CLONE_SYSVSEM -os.CLONE_THREAD -os.CLONE_VM os.DirEntry.is_junction -os.EFD_CLOEXEC -os.EFD_NONBLOCK -os.EFD_SEMAPHORE -os.SPLICE_F_MORE -os.SPLICE_F_MOVE -os.SPLICE_F_NONBLOCK os.eventfd os.eventfd_read os.eventfd_write From 90e7851de0a5b2a85b14ceb56a429dfb68860dd4 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:29:11 -0700 Subject: [PATCH 06/10] more --- tests/stubtest_allowlists/linux-py312.txt | 1 - tests/stubtest_allowlists/py310.txt | 1 + tests/stubtest_allowlists/py311.txt | 1 + tests/stubtest_allowlists/py312.txt | 6 ++++++ tests/stubtest_allowlists/py37.txt | 1 + tests/stubtest_allowlists/py38.txt | 1 + tests/stubtest_allowlists/py39.txt | 1 + tests/stubtest_allowlists/py3_common.txt | 1 - 8 files changed, 11 insertions(+), 2 deletions(-) diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index bc054708cc25..15ff9c2b12ca 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -1,4 +1,3 @@ -_?curses.color_pair mmap.MAP_STACK fcntl.FICLONE fcntl.FICLONERANGE diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 11df20b1665f..b5e5012812d6 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -54,6 +54,7 @@ typing._TypedDict.update typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update +typing_extensions\.get_original_bases # Exist at runtime for internal reasons, no need to put them in the stub typing_extensions\.TypeAliasType\.__call__ diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index dbaa5849cb0b..1c53c2aea6ab 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -47,6 +47,7 @@ tkinter._VersionInfoType.__doc__ typing.NewType.__call__ typing.NewType.__mro_entries__ weakref.WeakValueDictionary.update +typing_extensions\.get_original_bases # Runtime has *args, **kwargs, but will error if any are supplied unittest.TestCase.__init_subclass__ diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 447667ccaec1..6497a61929f2 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -280,6 +280,12 @@ zipfile.Path.relative_to zipfile.Path.rglob zoneinfo.ZoneInfo.from_file +array.array.__release_buffer__ +builtins.bytearray.__release_buffer__ +builtins.memoryview.__release_buffer__ +mmap.mmap.__release_buffer__ +pickle.PickleBuffer.__release_buffer__ + # Errors that also existed on Python 3.11 _collections_abc.AsyncGenerator.ag_await _collections_abc.AsyncGenerator.ag_code diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index f2f155fcab39..5593552eaa6e 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -52,6 +52,7 @@ uuid.UUID.int uuid.UUID.is_safe xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 xml.etree.cElementTree.TreeBuilder.start # bpo-39495 +typing_extensions\.get_original_bases # Exist at runtime for internal reasons, no need to put them in the stub typing_extensions\.TypeAliasType\.__call__ diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 318c89b12993..c7cabe0b3e63 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -71,6 +71,7 @@ xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modu xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signature xml.etree.cElementTree.TreeBuilder.start # bpo-39495 xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature +typing_extensions\.get_original_bases # Exist at runtime for internal reasons, no need to put them in the stub typing_extensions\.TypeAliasType\.__call__ diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index c5225803b743..1e4e56887dee 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -75,6 +75,7 @@ typing._TypedDict.update typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update +typing_extensions\.get_original_bases # Exist at runtime for internal reasons, no need to put them in the stub typing_extensions\.TypeAliasType\.__call__ diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index ec988f7989c0..7b57dbc68926 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -451,7 +451,6 @@ typing_extensions.NewType.__mro_entries__ # just exists for an error message # https://github.com/python/mypy/issues/15302 typing_extensions.NewType.__call__ typing_extensions\.deprecated -typing_extensions\.get_original_bases typing_extensions\.override # These are abstract properties at runtime, From d18219580e3628f2ddee9f935d8215a058eea47c Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:31:56 -0700 Subject: [PATCH 07/10] more --- tests/stubtest_allowlists/darwin-py312.txt | 38 +++++++++++++++++++--- tests/stubtest_allowlists/linux-py312.txt | 11 ++++--- tests/stubtest_allowlists/py312.txt | 6 ---- 3 files changed, 41 insertions(+), 14 deletions(-) diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index bca57a758189..4b1e2d8dc223 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -1,10 +1,40 @@ -_?curses.color_pair -xxlimited.Xxo.x_exports +_curses.unget_wch +_curses.window.get_wch +_socket.ETHERTYPE_ARP +_socket.ETHERTYPE_IP +_socket.ETHERTYPE_IPV6 +_socket.ETHERTYPE_VLAN +_socket.IP_ADD_SOURCE_MEMBERSHIP +_socket.IP_BLOCK_SOURCE +_socket.IP_DROP_SOURCE_MEMBERSHIP +_socket.IP_PKTINFO +_socket.IP_UNBLOCK_SOURCE +curses.unget_wch +curses.window.get_wch fcntl.FICLONE fcntl.FICLONERANGE - -# Exists at runtime, missing from stub +os.PRIO_DARWIN_BG +os.PRIO_DARWIN_NONUI +os.PRIO_DARWIN_PROCESS +os.PRIO_DARWIN_THREAD +posix.DirEntry.is_junction +posix.PRIO_DARWIN_BG +posix.PRIO_DARWIN_NONUI +posix.PRIO_DARWIN_PROCESS +posix.PRIO_DARWIN_THREAD +socket.ETHERTYPE_ARP +socket.ETHERTYPE_IP +socket.ETHERTYPE_IPV6 +socket.ETHERTYPE_VLAN +socket.IP_ADD_SOURCE_MEMBERSHIP +socket.IP_BLOCK_SOURCE +socket.IP_DROP_SOURCE_MEMBERSHIP +socket.IP_PKTINFO +socket.IP_UNBLOCK_SOURCE socket.TCP_CONNECTION_INFO +syslog.LOG_MASK +syslog.LOG_UPTO +xxlimited.Xxo.x_exports (dbm.gnu)? (locale.bind_textdomain_codeset)? diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index 15ff9c2b12ca..20d4286af153 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -1,6 +1,3 @@ -mmap.MAP_STACK -fcntl.FICLONE -fcntl.FICLONERANGE (os|posix).CLONE_FILES (os|posix).CLONE_FS (os|posix).CLONE_NEWCGROUP @@ -30,8 +27,14 @@ fcntl.FICLONERANGE (os|posix).SPLICE_F_MOVE (os|posix).SPLICE_F_NONBLOCK (os|posix).unshare +fcntl.FICLONE +fcntl.FICLONERANGE +mmap.MAP_STACK signal.sigtimedwait signal.sigwaitinfo -xxlimited.Xxo.x_exports +ssl.OP_ENABLE_KTLS +ssl.Options.OP_ENABLE_KTLS syslog.LOG_MASK syslog.LOG_UPTO +syslog.setlogmask +xxlimited.Xxo.x_exports diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 6497a61929f2..802165a0552d 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -148,8 +148,6 @@ posixpath.splitroot pydoc.HTMLRepr.__init__ pydoc.TextRepr.__init__ resource.prlimit -signal.sigtimedwait -signal.sigwaitinfo smtplib.SMTP.starttls smtplib.SMTP_SSL.__init__ sqlite3.Connection.autocommit @@ -197,9 +195,7 @@ sqlite3.enable_shared_cache sre_parse.Tokenizer.checkgroupname sre_parse.expand_template sre_parse.parse_template -ssl.OP_ENABLE_KTLS ssl.OP_LEGACY_SERVER_CONNECT -ssl.Options.OP_ENABLE_KTLS ssl.Options.OP_LEGACY_SERVER_CONNECT ssl.RAND_pseudo_bytes ssl.wrap_socket @@ -207,7 +203,6 @@ sys.activate_stack_trampoline sys.deactivate_stack_trampoline sys.getunicodeinternedsize sys.is_stack_trampoline_active -syslog.setlogmask tarfile.AbsoluteLinkError tarfile.AbsolutePathError tarfile.FilterError @@ -272,7 +267,6 @@ urllib.request.HTTPSHandler.__init__ uuid.main webbrowser.Galeon webbrowser.Grail -xxlimited.Xxo.x_exports zipfile.Path.glob zipfile.Path.is_symlink zipfile.Path.match From da35cf5b30746692bfd293c732d9297be1c96832 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:34:50 -0700 Subject: [PATCH 08/10] more --- tests/stubtest_allowlists/darwin-py312.txt | 2 -- tests/stubtest_allowlists/linux-py312.txt | 1 + tests/stubtest_allowlists/py312.txt | 11 ----------- 3 files changed, 1 insertion(+), 13 deletions(-) diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index 4b1e2d8dc223..aa844dfe7007 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -11,8 +11,6 @@ _socket.IP_PKTINFO _socket.IP_UNBLOCK_SOURCE curses.unget_wch curses.window.get_wch -fcntl.FICLONE -fcntl.FICLONERANGE os.PRIO_DARWIN_BG os.PRIO_DARWIN_NONUI os.PRIO_DARWIN_PROCESS diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index 20d4286af153..36e4e5f5a919 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -30,6 +30,7 @@ fcntl.FICLONE fcntl.FICLONERANGE mmap.MAP_STACK +resource.prlimit signal.sigtimedwait signal.sigwaitinfo ssl.OP_ENABLE_KTLS diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index 802165a0552d..eb75d92cbb65 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -104,7 +104,6 @@ logging.Logger.getChildren logging.__all__ logging.getHandlerByName logging.getHandlerNames -mmap.MAP_STACK multiprocessing.connection.deliver_challenge multiprocessing.queues.Queue.__class_getitem__ ntpath.__all__ @@ -115,18 +114,9 @@ opcode.hasarg opcode.hasexc opcode.hasnargs os.DirEntry.is_junction -os.eventfd -os.eventfd_read -os.eventfd_write os.path.__all__ os.path.isjunction os.path.splitroot -os.sendfile -os.setns -os.setresgid -os.setresuid -os.splice -os.unshare pathlib.Path.__init__ pathlib.Path.exists pathlib.Path.glob @@ -147,7 +137,6 @@ posixpath.isjunction posixpath.splitroot pydoc.HTMLRepr.__init__ pydoc.TextRepr.__init__ -resource.prlimit smtplib.SMTP.starttls smtplib.SMTP_SSL.__init__ sqlite3.Connection.autocommit From 92aec67931bf308fdd1f6e199c1f2396ebed2fc5 Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:38:22 -0700 Subject: [PATCH 09/10] close to the end --- tests/stubtest_allowlists/darwin-py312.txt | 6 ++++++ tests/stubtest_allowlists/linux-py312.txt | 5 +++++ tests/stubtest_allowlists/py312.txt | 6 ------ tests/stubtest_stdlib.py | 1 - 4 files changed, 11 insertions(+), 7 deletions(-) diff --git a/tests/stubtest_allowlists/darwin-py312.txt b/tests/stubtest_allowlists/darwin-py312.txt index aa844dfe7007..73a929a68a5b 100644 --- a/tests/stubtest_allowlists/darwin-py312.txt +++ b/tests/stubtest_allowlists/darwin-py312.txt @@ -1,5 +1,7 @@ +_?curses.color_pair _curses.unget_wch _curses.window.get_wch +_posixsubprocess.fork_exec _socket.ETHERTYPE_ARP _socket.ETHERTYPE_IP _socket.ETHERTYPE_IPV6 @@ -32,6 +34,10 @@ socket.IP_UNBLOCK_SOURCE socket.TCP_CONNECTION_INFO syslog.LOG_MASK syslog.LOG_UPTO +syslog.setlogmask +tty.__all__ +tty.cfmakecbreak +tty.cfmakeraw xxlimited.Xxo.x_exports (dbm.gnu)? diff --git a/tests/stubtest_allowlists/linux-py312.txt b/tests/stubtest_allowlists/linux-py312.txt index 36e4e5f5a919..22a7c72d68e7 100644 --- a/tests/stubtest_allowlists/linux-py312.txt +++ b/tests/stubtest_allowlists/linux-py312.txt @@ -1,3 +1,5 @@ +_?curses.color_pair +_posixsubprocess.fork_exec (os|posix).CLONE_FILES (os|posix).CLONE_FS (os|posix).CLONE_NEWCGROUP @@ -38,4 +40,7 @@ ssl.Options.OP_ENABLE_KTLS syslog.LOG_MASK syslog.LOG_UPTO syslog.setlogmask +tty.__all__ +tty.cfmakecbreak +tty.cfmakeraw xxlimited.Xxo.x_exports diff --git a/tests/stubtest_allowlists/py312.txt b/tests/stubtest_allowlists/py312.txt index eb75d92cbb65..3e14f8b9233c 100644 --- a/tests/stubtest_allowlists/py312.txt +++ b/tests/stubtest_allowlists/py312.txt @@ -1,7 +1,5 @@ # Uncategorised, from Python 3.12 _ctypes.SIZEOF_TIME_T -_curses.color_pair -_posixsubprocess.fork_exec _thread.daemon_threads_allowed argparse.BooleanOptionalAction.__init__ array.array.__class_getitem__ @@ -41,7 +39,6 @@ configparser.ParsingError.__init__ configparser.RawConfigParser.readfp configparser.__all__ ctypes.c_time_t -curses.color_pair datetime.__all__ dis.__all__ dis.hasarg @@ -217,9 +214,6 @@ tokenize.FSTRING_END tokenize.FSTRING_MIDDLE tokenize.FSTRING_START tokenize.__all__ -tty.__all__ -tty.cfmakecbreak -tty.cfmakeraw turtle.RawTurtle.teleport turtle.TNavigator.teleport turtle.TPen.teleport diff --git a/tests/stubtest_stdlib.py b/tests/stubtest_stdlib.py index ebe49876c82b..496e28a3745a 100755 --- a/tests/stubtest_stdlib.py +++ b/tests/stubtest_stdlib.py @@ -57,7 +57,6 @@ def run_stubtest(typeshed_dir: Path) -> int: str(allowlist_dir / "py3_common.txt"), "--allowlist", str(allowlist_dir / version_allowlist), - "--generate-allowlist", ] if (allowlist_dir / platform_allowlist).exists(): cmd += ["--allowlist", str(allowlist_dir / platform_allowlist)] From 4caa20b19506ebae3854e6f39d831d6a3397cebd Mon Sep 17 00:00:00 2001 From: hauntsaninja Date: Sat, 3 Jun 2023 22:41:31 -0700 Subject: [PATCH 10/10] more --- tests/stubtest_allowlists/py310.txt | 3 ++- tests/stubtest_allowlists/py311.txt | 2 ++ tests/stubtest_allowlists/py37.txt | 2 ++ tests/stubtest_allowlists/py38.txt | 3 ++- tests/stubtest_allowlists/py39.txt | 2 ++ 5 files changed, 10 insertions(+), 2 deletions(-) diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index b5e5012812d6..f68a49e4c783 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -199,11 +199,12 @@ typing\.Annotated .*.__buffer__ .*.__release_buffer__ - # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted +asynchat.async_chat.encoding +asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index 1c53c2aea6ab..80fea43ba362 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -169,6 +169,8 @@ typing\.ParamSpec\.__.*__ distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted +asynchat.async_chat.encoding +asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index 5593552eaa6e..3a7413858aed 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -179,6 +179,8 @@ typing\.Protocol distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted +asynchat.async_chat.encoding +asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index c7cabe0b3e63..1e9ca5638c6a 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -193,11 +193,12 @@ typing_extensions\.Final .*.__buffer__ .*.__release_buffer__ - # Removed in 3.12 distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted +asynchat.async_chat.encoding +asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..* diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index 1e4e56887dee..277efd02f0a6 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -195,6 +195,8 @@ typing\.Annotated distutils\..* asyncore.dispatcher.addr asyncore.dispatcher.handle_accepted +asynchat.async_chat.encoding +asynchat.async_chat.use_encoding asynchat.find_prefix_at_end pkgutil.ImpImporter\..* pkgutil.ImpLoader\..*