diff --git a/tests/stubtest_allowlists/darwin-py310.txt b/tests/stubtest_allowlists/darwin-py310.txt index d53ae6638..d3aa8357f 100644 --- a/tests/stubtest_allowlists/darwin-py310.txt +++ b/tests/stubtest_allowlists/darwin-py310.txt @@ -2,8 +2,12 @@ _?curses.A_ITALIC _?curses.color_pair webbrowser.MacOSXOSAScript.__init__ -distutils.command.bdist_msi # msi is only available on windows - # Exists at runtime, but missing from stubs mmap.MADV_FREE distutils.util.__warningregistry__ + +# ========== +# 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-py36.txt b/tests/stubtest_allowlists/darwin-py36.txt index 788e7a699..0e5fb3f22 100644 --- a/tests/stubtest_allowlists/darwin-py36.txt +++ b/tests/stubtest_allowlists/darwin-py36.txt @@ -1,10 +1,5 @@ ctypes.wintypes -ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 pwd.getpwnam -ssl.PROTOCOL_SSLv3 # Depends on openssl compilation -ssl.RAND_egd # Depends on openssl compilation - -distutils.command.bdist_msi # msi is only available on windows webbrowser.MacOSXOSAScript.__init__ @@ -15,3 +10,12 @@ ssl.OP_ENABLE_MIDDLEBOX_COMPAT ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT uuid.lib + +# ========== +# 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 +ssl.PROTOCOL_SSLv3 # Depends on openssl compilation +ssl.RAND_egd # Depends on openssl compilation diff --git a/tests/stubtest_allowlists/darwin-py37.txt b/tests/stubtest_allowlists/darwin-py37.txt index 82684b817..c33bf5959 100644 --- a/tests/stubtest_allowlists/darwin-py37.txt +++ b/tests/stubtest_allowlists/darwin-py37.txt @@ -1,7 +1,11 @@ _?curses.A_ITALIC ctypes.wintypes -ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 pwd.getpwnam webbrowser.MacOSXOSAScript.__init__ -distutils.command.bdist_msi # msi is only available on windows +# ========== +# 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 index 038ae65a9..6edf54de4 100644 --- a/tests/stubtest_allowlists/darwin-py38.txt +++ b/tests/stubtest_allowlists/darwin-py38.txt @@ -1,7 +1,11 @@ _?curses.A_ITALIC webbrowser.MacOSXOSAScript.__init__ -distutils.command.bdist_msi # msi is only available on windows - # Exists at runtime, but missing from stubs mmap.MADV_FREE + +# ========== +# 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 index 038ae65a9..6edf54de4 100644 --- a/tests/stubtest_allowlists/darwin-py39.txt +++ b/tests/stubtest_allowlists/darwin-py39.txt @@ -1,7 +1,11 @@ _?curses.A_ITALIC webbrowser.MacOSXOSAScript.__init__ -distutils.command.bdist_msi # msi is only available on windows - # Exists at runtime, but missing from stubs mmap.MADV_FREE + +# ========== +# 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.txt b/tests/stubtest_allowlists/darwin.txt index bbb823a2f..f054ba89c 100644 --- a/tests/stubtest_allowlists/darwin.txt +++ b/tests/stubtest_allowlists/darwin.txt @@ -1,9 +1,4 @@ _posixsubprocess.cloexec_pipe -_?curses.ACS_.* # ACS codes are initialized only after initscr call. -curses.COLORS # Initialized after start_color -curses.COLOR_PAIRS # Initialized after start_color -curses.COLS # Initialized only after initscr call. -curses.LINES # Initialized only after initscr call. os.EX_NOTFOUND os.SF_MNOWAIT os.SF_NODISKIO @@ -15,6 +10,23 @@ select.KQ_FILTER_NETDEV # system dependent select.kqueue.__init__ # default C signature is wrong select.POLLMSG # system dependent +# 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.AddressInfo.AI_DEFAULT +socket.AddressInfo.AI_MASK +socket.AddressInfo.AI_V4MAPPED_CFG +socket.MsgFlag.MSG_EOF + +posix.NGROUPS_MAX +posix.error.characters_written +resource.error.characters_written +select.POLLRDHUP +webbrowser.MacOSX.__init__ + # ========== # Allowlist entries that cannot or should not be fixed # ========== @@ -42,19 +54,8 @@ stat.FILE_ATTRIBUTE_[A-Z_]+ tkinter.Tk.createfilehandler tkinter.Tk.deletefilehandler -# 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.AddressInfo.AI_DEFAULT -socket.AddressInfo.AI_MASK -socket.AddressInfo.AI_V4MAPPED_CFG -socket.MsgFlag.MSG_EOF - -posix.NGROUPS_MAX -posix.error.characters_written -resource.error.characters_written -select.POLLRDHUP -webbrowser.MacOSX.__init__ +_?curses.ACS_.* # ACS codes are initialized only after initscr call +curses.COLORS # Initialized after start_color +curses.COLOR_PAIRS # Initialized after start_color +curses.COLS # Initialized only after initscr call +curses.LINES # Initialized only after initscr call diff --git a/tests/stubtest_allowlists/linux-py310.txt b/tests/stubtest_allowlists/linux-py310.txt index 2f43a04cd..489baa748 100644 --- a/tests/stubtest_allowlists/linux-py310.txt +++ b/tests/stubtest_allowlists/linux-py310.txt @@ -1,5 +1,4 @@ -_curses.color_pair -curses.color_pair +_?curses.color_pair (os|posix).EFD_CLOEXEC (os|posix).EFD_NONBLOCK (os|posix).EFD_SEMAPHORE @@ -27,7 +26,11 @@ signal.sigtimedwait signal.sigwaitinfo select.epoll.register -distutils.command.bdist_msi # msi is only available on windows - # Exists at runtime, but missing from stubs distutils.command.build_ext.__warningregistry__ + +# ========== +# 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-py36.txt b/tests/stubtest_allowlists/linux-py36.txt index c0e987135..8b532ef66 100644 --- a/tests/stubtest_allowlists/linux-py36.txt +++ b/tests/stubtest_allowlists/linux-py36.txt @@ -1,8 +1,5 @@ ctypes.wintypes -ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 pwd.getpwnam -ssl.PROTOCOL_SSLv3 # Depends on openssl compilation -ssl.RAND_egd # Depends on openssl compilation # Exists at runtime, but missing from stubs ntpath.splitunc @@ -11,4 +8,11 @@ ssl.OP_ENABLE_MIDDLEBOX_COMPAT ssl.Options.OP_ENABLE_MIDDLEBOX_COMPAT uuid.lib -distutils.command.bdist_msi # msi is only available on windows +# ========== +# 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 +ssl.PROTOCOL_SSLv3 # Depends on openssl compilation +ssl.RAND_egd # Depends on openssl compilation diff --git a/tests/stubtest_allowlists/linux-py37.txt b/tests/stubtest_allowlists/linux-py37.txt index 2f149957d..e300b9f16 100644 --- a/tests/stubtest_allowlists/linux-py37.txt +++ b/tests/stubtest_allowlists/linux-py37.txt @@ -1,5 +1,9 @@ ctypes.wintypes -ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 pwd.getpwnam -distutils.command.bdist_msi # msi is only available on windows +# ========== +# 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 a6d01b0ee..e13cc7b14 100644 --- a/tests/stubtest_allowlists/linux-py38.txt +++ b/tests/stubtest_allowlists/linux-py38.txt @@ -1,3 +1,7 @@ select.epoll.register -distutils.command.bdist_msi # msi is only available on windows +# ========== +# 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 ac790c104..65371563b 100644 --- a/tests/stubtest_allowlists/linux-py39.txt +++ b/tests/stubtest_allowlists/linux-py39.txt @@ -1,4 +1,8 @@ (os|posix).sendfile select.epoll.register -distutils.command.bdist_msi # msi is only available on windows +# ========== +# 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.txt b/tests/stubtest_allowlists/linux.txt index 893356847..f352c3631 100644 --- a/tests/stubtest_allowlists/linux.txt +++ b/tests/stubtest_allowlists/linux.txt @@ -1,9 +1,4 @@ _posixsubprocess.cloexec_pipe -_?curses.ACS_.* # ACS codes are initialized only after initscr call. -curses.COLORS # Initialized after start_color -curses.COLOR_PAIRS # Initialized after start_color -curses.COLS # Initialized only after initscr call. -curses.LINES # Initialized only after initscr call. os.EX_NOTFOUND os.SF_MNOWAIT os.SF_NODISKIO @@ -16,6 +11,21 @@ selectors.KqueueSelector signal.SIGEMT signal.SIGINFO +# 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.MsgFlag.MSG_CMSG_CLOEXEC +socket.MsgFlag.MSG_CONFIRM +socket.MsgFlag.MSG_ERRQUEUE +socket.MsgFlag.MSG_FASTOPEN +socket.MsgFlag.MSG_MORE +socket.MsgFlag.MSG_NOSIGNAL +spwd.struct_spwd.sp_nam +spwd.struct_spwd.sp_pwd + # ========== # Allowlist entries that cannot or should not be fixed # ========== @@ -46,17 +56,8 @@ stat.FILE_ATTRIBUTE_[A-Z_]+ tkinter.Tk.createfilehandler tkinter.Tk.deletefilehandler -# 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.MsgFlag.MSG_CMSG_CLOEXEC -socket.MsgFlag.MSG_CONFIRM -socket.MsgFlag.MSG_ERRQUEUE -socket.MsgFlag.MSG_FASTOPEN -socket.MsgFlag.MSG_MORE -socket.MsgFlag.MSG_NOSIGNAL -spwd.struct_spwd.sp_nam -spwd.struct_spwd.sp_pwd +_?curses.ACS_.* # ACS codes are initialized only after initscr call +curses.COLORS # Initialized after start_color +curses.COLOR_PAIRS # Initialized after start_color +curses.COLS # Initialized only after initscr call +curses.LINES # Initialized only after initscr call diff --git a/tests/stubtest_allowlists/py310.txt b/tests/stubtest_allowlists/py310.txt index 4f4915aa6..230f5ba8a 100644 --- a/tests/stubtest_allowlists/py310.txt +++ b/tests/stubtest_allowlists/py310.txt @@ -3,78 +3,43 @@ _collections_abc.AsyncGenerator.ag_await _collections_abc.AsyncGenerator.ag_code _collections_abc.AsyncGenerator.ag_frame _collections_abc.AsyncGenerator.ag_running +_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. _collections_abc.ItemsView.__reversed__ _collections_abc.KeysView.__reversed__ _collections_abc.ValuesView.__reversed__ - -# 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 - -_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 -ast.Bytes.__new__ -ast.Ellipsis.__new__ -ast.ExtSlice.__new__ ast.ImportFrom.level -ast.Index.__new__ -ast.NameConstant.__new__ -ast.Num.__new__ -ast.Str.__new__ asyncio.Future.__init__ # Usually initialized from c object asyncio.futures.Future.__init__ # Usually initialized from c object builtins.dict.get builtins.float.__setformat__ # Internal method for CPython test suite builtins.property.__set_name__ # Doesn't actually exist -contextvars.Context.__init__ # Default C __init__ signature is wrong contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ dataclasses.field dataclasses.KW_ONLY 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 gettext.install gettext.translation hmac.new # Stub is a white lie; see comments in the stub http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded -importlib.abc.Traversable.__init__ # Inherits __init__ from typing.Protocol -importlib.metadata.PackageMetadata.__init__ # Inherits __init__ from typing.Protocol -importlib.metadata._meta.PackageMetadata.__init__ # Inherits __init__ from typing.Protocol -importlib.metadata._meta.SimplePath.__init__ # Inherits __init__ from typing.Protocol ipaddress.IPv4Interface.hostmask ipaddress.IPv6Interface.hostmask ipaddress._BaseNetwork.broadcast_address ipaddress._BaseNetwork.hostmask multiprocessing.spawn._main -os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem pickle.Pickler.reducer_override # implemented in C pickler # platform.uname_result's processor field is now dynamically made to exist platform.uname_result.__match_args__ platform.uname_result.__new__ platform.uname_result._fields platform.uname_result.processor -queue.SimpleQueue.__init__ # Default C __init__ signature is wrong re.Pattern.scanner # Undocumented and not useful. #6405 -ssl.PROTOCOL_SSLv3 # Depends on ssl compilation -ssl.RAND_egd # Depends on openssl compilation symtable.SymbolTable.has_exec sys.UnraisableHookArgs # Not exported from sys tkinter.Tk.split types.ClassMethodDescriptorType.__get__ -types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime types.GenericAlias.__getattr__ types.GenericAlias.__mro_entries__ types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 @@ -82,13 +47,6 @@ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ typing._SpecialForm.__mro_entries__ typing.ForwardRef._evaluate -typing.SupportsAbs.__init__ -typing.SupportsBytes.__init__ -typing.SupportsComplex.__init__ -typing.SupportsFloat.__init__ -typing.SupportsIndex.__init__ -typing.SupportsInt.__init__ -typing.SupportsRound.__init__ typing._SpecialForm.__init__ typing._TypedDict.__delitem__ typing._TypedDict.__ior__ @@ -102,26 +60,6 @@ typing._TypedDict.update typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update -xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signature -xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature - -# 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 - -# These enums derive from (str, Enum). See comment in py3_common.txt -pstats.SortKey.__new__ -tkinter.EventType.__new__ # stubtest complains that in 3.10 the default argument is inconsistent with the annotation, # but in 3.10+ calling the function without the default argument is in fact deprecated, @@ -174,6 +112,44 @@ xml.parsers.expat.XMLParserType.SkippedEntityHandler xml.parsers.expat.XMLParserType.intern xml.sax.handler.LexicalHandler +# ========== +# 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 +# ========== + # Side effects from module initialization _compat_pickle.excname email.contentmanager.maintype @@ -188,3 +164,39 @@ lib2to3.pgen2.grammar.op pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 + +# 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__ +contextvars.Context.__init__ +queue.SimpleQueue.__init__ +xml.etree.ElementTree.XMLParser.__init__ +xml.etree.cElementTree.XMLParser.__init__ + +# Inherits __init__ from typing.Protocol +importlib.abc.Traversable.__init__ +importlib.metadata.PackageMetadata.__init__ +importlib.metadata._meta.PackageMetadata.__init__ +importlib.metadata._meta.SimplePath.__init__ +typing.SupportsAbs.__init__ +typing.SupportsBytes.__init__ +typing.SupportsComplex.__init__ +typing.SupportsFloat.__init__ +typing.SupportsIndex.__init__ +typing.SupportsInt.__init__ +typing.SupportsRound.__init__ + +ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 +os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem +ssl.PROTOCOL_SSLv3 # Depends on ssl compilation +ssl.RAND_egd # Depends on openssl compilation +types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime + +# These enums derive from (str, Enum). See comment in py3_common.txt +pstats.SortKey.__new__ +tkinter.EventType.__new__ diff --git a/tests/stubtest_allowlists/py311.txt b/tests/stubtest_allowlists/py311.txt index ac66c9e11..07c8c8a01 100644 --- a/tests/stubtest_allowlists/py311.txt +++ b/tests/stubtest_allowlists/py311.txt @@ -5,20 +5,14 @@ _collections_abc.AsyncGenerator.ag_await _collections_abc.AsyncGenerator.ag_code _collections_abc.AsyncGenerator.ag_frame _collections_abc.AsyncGenerator.ag_running -_collections_abc.AsyncGenerator.athrow +_collections_abc.AsyncGenerator.athrow # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. _collections_abc.AsyncIterable.__class_getitem__ _collections_abc.Awaitable.__class_getitem__ _collections_abc.Container.__class_getitem__ -_collections_abc.Coroutine.send -_collections_abc.Coroutine.throw -_collections_abc.Generator.send -_collections_abc.Generator.throw _collections_abc.ItemsView.__reversed__ _collections_abc.Iterable.__class_getitem__ _collections_abc.KeysView.__reversed__ _collections_abc.MappingView.__class_getitem__ -_collections_abc.MutableMapping.pop -_collections_abc.MutableMapping.setdefault _collections_abc.ValuesView.__reversed__ _csv.Reader _csv.Writer @@ -27,21 +21,14 @@ _imp.get_frozen_object _imp.source_hash _operator.attrgetter.__vectorcalloffset__ _operator.itemgetter.__vectorcalloffset__ -_weakref.ProxyType.__reversed__ +_weakref.ProxyType.__reversed__ # Doesn't really exist argparse._AppendConstAction.__init__ argparse._MutuallyExclusiveGroup.add_mutually_exclusive_group argparse._StoreConstAction.__init__ -ast.Bytes.__new__ -ast.Ellipsis.__new__ -ast.ExtSlice.__new__ ast.ImportFrom.level -ast.Index.__new__ -ast.NameConstant.__new__ -ast.Num.__new__ -ast.Str.__new__ ast.Tuple.dims ast.main -asynchat.__warningregistry__ +asynchat.__warningregistry__ # Removal planned for 3.12, can add if someone needs this asyncio.AbstractEventLoop.connect_accepted_socket asyncio.AbstractEventLoop.create_connection asyncio.AbstractEventLoop.create_server @@ -132,7 +119,7 @@ bdb.Breakpoint.clearBreakpoints binascii.a2b_base64 builtins.BaseException.add_note builtins.dict.get -builtins.property.__set_name__ +builtins.property.__set_name__ # Doesn't actually exist concurrent.futures.ProcessPoolExecutor.__init__ concurrent.futures.process.ProcessPoolExecutor.__init__ concurrent.futures.process._ResultItem.__init__ @@ -166,19 +153,14 @@ enum.Flag.__rxor__ enum.StrEnum.value enum._EnumDict.update fractions.Fraction.__int__ -fractions.Fraction.__new__ +fractions.Fraction.__new__ # overload is too complicated for stubtest to resolve ftplib.FTP.trust_server_pasv_ipv4_address functools.partial.__vectorcalloffset__ gettext.install -hmac.new +hmac.new # Stub is a white lie; see comments in the stub http.HTTPMethod.description -http.server.SimpleHTTPRequestHandler.__init__ +http.server.SimpleHTTPRequestHandler.__init__ # *args is expanded imp.get_frozen_object -importlib.abc.Traversable.__init__ -importlib.metadata.EntryPoint.__init__ -importlib.metadata.PackageMetadata.__init__ -importlib.metadata._meta.PackageMetadata.__init__ -importlib.metadata._meta.SimplePath.__init__ importlib.resources.Resource inspect._ParameterKind.description ipaddress.IPv4Interface.hostmask @@ -197,19 +179,15 @@ multiprocessing.managers.SharedMemoryServer.release_segment multiprocessing.managers.SharedMemoryServer.shutdown multiprocessing.managers.SharedMemoryServer.track_segment multiprocessing.spawn._main -ntpath.join operator.attrgetter.__vectorcalloffset__ operator.itemgetter.__vectorcalloffset__ -os.PathLike.__class_getitem__ -os.path.join os.popen -pickle.Pickler.reducer_override +pickle.Pickler.reducer_override # implemented in C pickler +# platform.uname_result's processor field is now dynamically made to exist platform.uname_result.__match_args__ platform.uname_result.__new__ platform.uname_result._fields platform.uname_result.processor -posixpath.join -pstats.SortKey.__new__ pydoc.HTMLDoc.heading pydoc.HTMLDoc.multicolumn pydoc.HTMLDoc.section @@ -222,7 +200,7 @@ pyexpat.errors.XML_ERROR_RESERVED_NAMESPACE_URI pyexpat.errors.XML_ERROR_RESERVED_PREFIX_XML pyexpat.errors.XML_ERROR_RESERVED_PREFIX_XMLNS queue.SimpleQueue.__init__ -re.Pattern.scanner +re.Pattern.scanner # Undocumented and not useful. #6405 re.T re.TEMPLATE re.template @@ -240,22 +218,17 @@ sre_parse.CALL sre_parse.SRE_FLAG_TEMPLATE sre_parse.Tokenizer.checkgroupname sre_parse.Verbose -ssl.PROTOCOL_SSLv3 -ssl.RAND_egd -ssl.SSLContext.__new__ -ssl._create_unverified_context string.Template.get_identifiers string.Template.is_valid subprocess.getoutput subprocess.getstatusoutput symtable.SymbolTable.has_exec -sys.UnraisableHookArgs +sys.UnraisableHookArgs # Not exported from sys sys.exception tempfile.SpooledTemporaryFile.detach tempfile.SpooledTemporaryFile.read1 tempfile.SpooledTemporaryFile.readinto tempfile.SpooledTemporaryFile.readinto1 -tkinter.EventType.__new__ tkinter._VersionInfoType.__doc__ traceback.StackSummary.format_frame_summary traceback.TracebackException.__init__ @@ -264,36 +237,17 @@ traceback.TracebackException.print types.ClassMethodDescriptorType.__get__ types.CodeType.co_exceptiontable types.CodeType.co_qualname -types.CodeType.replace types.CoroutineType.cr_suspended -types.DynamicClassAttribute.deleter -types.DynamicClassAttribute.getter -types.DynamicClassAttribute.setter types.GeneratorType.gi_suspended -types.GenericAlias.__call__ +types.GenericAlias.__call__ # Would be complicated to fix properly, Any could silence problems. #6392 types.GenericAlias.__getattr__ types.GenericAlias.__mro_entries__ types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ -typing.BinaryIO.write typing.ForwardRef._evaluate -typing.IO.read -typing.IO.readline -typing.IO.readlines -typing.IO.seek -typing.IO.truncate -typing.IO.write -typing.IO.writelines typing.NewType.__call__ typing.NewType.__mro_entries__ typing.ParamSpec.__typing_subst__ -typing.SupportsAbs.__init__ -typing.SupportsBytes.__init__ -typing.SupportsComplex.__init__ -typing.SupportsFloat.__init__ -typing.SupportsIndex.__init__ -typing.SupportsInt.__init__ -typing.SupportsRound.__init__ typing.TypeVar.__typing_subst__ typing.TypeVarTuple.__typing_subst__ typing._SpecialForm.__call__ @@ -315,23 +269,15 @@ unittest.case.TestCase._addSkip unittest.doModuleCleanups urllib.request.FancyURLopener.http_error_308 urllib.request.HTTPRedirectHandler.http_error_308 -weakref.ProxyType.__reversed__ +weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update -wsgiref.types.ErrorStream.__init__ -wsgiref.types.FileWrapper.__call__ -wsgiref.types.FileWrapper.__init__ -wsgiref.types.InputStream.__init__ wsgiref.types.InputStream.read wsgiref.types.InputStream.readline wsgiref.types.InputStream.readlines wsgiref.types.StartResponse.__call__ -wsgiref.types.StartResponse.__init__ wsgiref.types.WSGIApplication wsgiref.types.WSGIEnvironment.get -wsgiref.types._Readable.__init__ wsgiref.types._Readable.read -xml.etree.ElementTree.XMLParser.__init__ -xml.etree.cElementTree.XMLParser.__init__ xml.parsers.expat.XMLParserType.SkippedEntityHandler xml.parsers.expat.XMLParserType.intern xml.parsers.expat.errors.XML_ERROR_AMPLIFICATION_LIMIT_BREACH @@ -347,3 +293,89 @@ zipfile.Path.suffix zipfile.Path.suffixes zipfile.ZipFile.__init__ zipfile.ZipFile.mkdir + +# stubtest complains that in 3.10 the default argument is inconsistent with the annotation, +# but in 3.10+ calling the function without the default argument is in fact deprecated, +# so it's better to ignore stubtest +ssl.SSLContext.__new__ +ssl._create_unverified_context + +# ========== +# 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 +# ========== + +# Inherits __init__ from typing.Protocol +importlib.abc.Traversable.__init__ +importlib.metadata.EntryPoint.__init__ +importlib.metadata.PackageMetadata.__init__ +importlib.metadata._meta.PackageMetadata.__init__ +importlib.metadata._meta.SimplePath.__init__ +typing.SupportsAbs.__init__ +typing.SupportsBytes.__init__ +typing.SupportsComplex.__init__ +typing.SupportsFloat.__init__ +typing.SupportsIndex.__init__ +typing.SupportsInt.__init__ +typing.SupportsRound.__init__ +wsgiref.types.ErrorStream.__init__ +wsgiref.types.FileWrapper.__call__ +wsgiref.types.FileWrapper.__init__ +wsgiref.types.InputStream.__init__ +wsgiref.types.StartResponse.__init__ +wsgiref.types._Readable.__init__ + +# 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__ +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 +ssl.PROTOCOL_SSLv3 # Depends on ssl compilation +ssl.RAND_egd # Depends on openssl compilation +types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime + +# These enums derive from (str, Enum). See comment in py3_common.txt +pstats.SortKey.__new__ +tkinter.EventType.__new__ diff --git a/tests/stubtest_allowlists/py36.txt b/tests/stubtest_allowlists/py36.txt index 7b1465937..58a052d7f 100644 --- a/tests/stubtest_allowlists/py36.txt +++ b/tests/stubtest_allowlists/py36.txt @@ -23,11 +23,6 @@ collections.AsyncGenerator.ag_frame collections.AsyncGenerator.ag_running collections.Callable collections.Mapping.__reversed__ # Set to None at runtime for a better error message -# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. -collections.Set.__rand__ -collections.Set.__ror__ -collections.Set.__rsub__ -collections.Set.__rxor__ collections.UserString.maketrans datetime.datetime_CAPI distutils.command.bdist_wininst # see #6523 @@ -100,13 +95,6 @@ tkinter.tix.wantobjects typing.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491 typing.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491 -builtins.memoryview.__iter__ # C type that implements __getitem__ -builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ -sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.Binary.__iter__ # C type that implements __getitem__ -sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only - sqlite3.OptimizedUnicode.maketrans sqlite3.dbapi2.OptimizedUnicode.maketrans @@ -128,10 +116,6 @@ tempfile.SpooledTemporaryFile.readable tempfile.SpooledTemporaryFile.seekable tempfile.SpooledTemporaryFile.writable -# Intentionally omitted because of syntax issues -asyncio.async -asyncio.tasks.async - # Exists at runtime, but missing from stubs _bisect.bisect _bisect.insort @@ -158,6 +142,14 @@ tkinter.dnd.test typing.[A-Z]\w*.__.*__ # many missing typing dunders in py36 xml.dom.xmlbuilder.DocumentLS.async +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# Intentionally omitted because of syntax issues +asyncio.async +asyncio.tasks.async + # Side effects from module initialization _compat_pickle.excname email.contentmanager.maintype @@ -172,3 +164,16 @@ lib2to3.pgen2.grammar.op pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 + +# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. +collections.Set.__rand__ +collections.Set.__ror__ +collections.Set.__rsub__ +collections.Set.__rxor__ + +builtins.memoryview.__iter__ # C type that implements __getitem__ +builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ +sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.Binary.__iter__ # C type that implements __getitem__ +sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only diff --git a/tests/stubtest_allowlists/py37.txt b/tests/stubtest_allowlists/py37.txt index dae780ab7..420b30ef3 100644 --- a/tests/stubtest_allowlists/py37.txt +++ b/tests/stubtest_allowlists/py37.txt @@ -25,13 +25,7 @@ collections.AsyncGenerator.ag_frame collections.AsyncGenerator.ag_running collections.Callable collections.Mapping.__reversed__ # Set to None at runtime for a better error message -# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. -collections.Set.__rand__ -collections.Set.__ror__ -collections.Set.__rsub__ -collections.Set.__rxor__ collections.UserString.maketrans -contextvars.Context.__init__ # Default C __init__ signature is wrong contextvars.ContextVar.get dataclasses.field distutils.command.bdist_wininst # see #6523 @@ -48,8 +42,6 @@ inspect.Signature.from_function # Removed in 3.11, can add if someone needs thi ipaddress._BaseNetwork.__init__ json.loads (os|posix).utime -pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args -queue.SimpleQueue.__init__ # Default C __init__ signature is wrong random.Random.randrange # missing undocumented arg _int re.Pattern.scanner # Undocumented and not useful. #6405 sched.Event.__doc__ # __slots__ is overridden @@ -70,18 +62,10 @@ uuid.UUID.is_safe uuid.getnode # undocumented, unused parameter getters that was later removed xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 xml.etree.cElementTree.TreeBuilder.start # bpo-39495 -xml.parsers.expat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args # These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt pstats.SortKey.__new__ tkinter.EventType.__new__ -builtins.memoryview.__iter__ # C type that implements __getitem__ -builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ -sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.Binary.__iter__ # C type that implements __getitem__ -sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only - sqlite3.OptimizedUnicode.maketrans sqlite3.dbapi2.OptimizedUnicode.maketrans @@ -150,6 +134,10 @@ tkinter.simpledialog.wantobjects tkinter.tix.wantobjects typing._SpecialForm.__call__ +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + # Side effects from module initialization _compat_pickle.excname email.contentmanager.maintype @@ -164,3 +152,23 @@ lib2to3.pgen2.grammar.op pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 + +# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. +collections.Set.__rand__ +collections.Set.__ror__ +collections.Set.__rsub__ +collections.Set.__rxor__ + +builtins.memoryview.__iter__ # C type that implements __getitem__ +builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ +sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.Binary.__iter__ # C type that implements __getitem__ +sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only + +# C signature is broader than what is actually accepted +contextvars.Context.__init__ +queue.SimpleQueue.__init__ + +pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args +xml.parsers.expat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args diff --git a/tests/stubtest_allowlists/py38.txt b/tests/stubtest_allowlists/py38.txt index 4b5bfc35d..1b490fbbd 100644 --- a/tests/stubtest_allowlists/py38.txt +++ b/tests/stubtest_allowlists/py38.txt @@ -32,12 +32,6 @@ collections.ItemsView.__reversed__ collections.KeysView.__reversed__ collections.ValuesView.__reversed__ collections.Mapping.__reversed__ # Set to None at runtime for a better error message -# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. -collections.Set.__rand__ -collections.Set.__ror__ -collections.Set.__rsub__ -collections.Set.__rxor__ -contextvars.Context.__init__ # Default C __init__ signature is wrong dataclasses.field distutils.command.bdist_wininst # see #6523 dummy_threading.Condition.acquire @@ -60,7 +54,6 @@ ipaddress._BaseNetwork.broadcast_address ipaddress._BaseNetwork.hostmask multiprocessing.spawn._main pickle.Pickler.reducer_override # implemented in C pickler -queue.SimpleQueue.__init__ # Default C __init__ signature is wrong random.Random.randrange # missing undocumented arg _int re.Pattern.scanner # Undocumented and not useful. #6405 sched.Event.__doc__ # __slots__ is overridden @@ -68,7 +61,6 @@ ssl.PROTOCOL_SSLv3 # Depends on ssl compilation ssl.RAND_egd # Depends on openssl compilation sys.UnraisableHookArgs # Not exported from sys types.ClassMethodDescriptorType.__get__ -types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime types.MethodDescriptorType.__get__ types.WrapperDescriptorType.__get__ typing.NamedTuple.__new__ @@ -84,7 +76,6 @@ typing.SupportsInt.__init__ typing.SupportsRound.__init__ typing._SpecialForm.__init__ typing._SpecialForm.__new__ -uuid.getnode # undocumented, unused parameter getters that was later removed weakref.WeakValueDictionary.update xml.etree.ElementTree.TreeBuilder.start # Discrepancy between Python and C modules, fixed in bpo-39495 xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signature @@ -94,12 +85,6 @@ xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signatu pstats.SortKey.__new__ tkinter.EventType.__new__ -builtins.memoryview.__iter__ # C type that implements __getitem__ -builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ -sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.Binary.__iter__ # C type that implements __getitem__ -sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only collections.Coroutine.cr_await collections.Coroutine.cr_code collections.Coroutine.cr_frame @@ -173,6 +158,10 @@ unicodedata.UCD.is_normalized xml.parsers.expat.XMLParserType.SkippedEntityHandler xml.parsers.expat.XMLParserType.intern +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + # Side effects from module initialization _compat_pickle.excname email.contentmanager.maintype @@ -187,3 +176,23 @@ lib2to3.pgen2.grammar.op pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 + +# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. +collections.Set.__rand__ +collections.Set.__ror__ +collections.Set.__rsub__ +collections.Set.__rxor__ + +builtins.memoryview.__iter__ # C type that implements __getitem__ +builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ +sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.Binary.__iter__ # C type that implements __getitem__ +sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only + +# C signature is broader than what is actually accepted +contextvars.Context.__init__ +queue.SimpleQueue.__init__ + +uuid.getnode # undocumented, unused parameter getters that was later removed +types.CodeType.replace # stubtest thinks default values are None but None doesn't work at runtime diff --git a/tests/stubtest_allowlists/py39.txt b/tests/stubtest_allowlists/py39.txt index beba4973e..f92100cea 100644 --- a/tests/stubtest_allowlists/py39.txt +++ b/tests/stubtest_allowlists/py39.txt @@ -32,19 +32,12 @@ collections.Mapping.__reversed__ # Set to None at runtime for a better error me collections.ItemsView.__reversed__ collections.KeysView.__reversed__ collections.ValuesView.__reversed__ -# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. -collections.Set.__rand__ -collections.Set.__ror__ -collections.Set.__rsub__ -collections.Set.__rxor__ -contextvars.Context.__init__ # Default C __init__ signature is wrong contextlib.AbstractAsyncContextManager.__class_getitem__ contextlib.AbstractContextManager.__class_getitem__ dataclasses.field distutils.command.bdist_wininst # see #6523 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 gettext.install gettext.translation hmac.new # Stub is a white lie; see comments in the stub @@ -57,13 +50,11 @@ ipaddress.IPv6Interface.hostmask ipaddress._BaseNetwork.broadcast_address ipaddress._BaseNetwork.hostmask multiprocessing.spawn._main -os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem pickle.Pickler.reducer_override # implemented in C pickler # platform.uname_result's processor field is now dynamically made to exist platform.uname_result.__new__ platform.uname_result._fields platform.uname_result.processor -queue.SimpleQueue.__init__ # Default C __init__ signature is wrong re.Pattern.scanner # Undocumented and not useful. #6405 sched.Event.__doc__ # __slots__ is overridden ssl.PROTOCOL_SSLv3 # Depends on ssl compilation @@ -98,19 +89,11 @@ typing._TypedDict.update typing._TypedDict.values weakref.ProxyType.__reversed__ # Doesn't really exist weakref.WeakValueDictionary.update -xml.etree.ElementTree.XMLParser.__init__ # Defined in C so has general signature -xml.etree.cElementTree.XMLParser.__init__ # Defined in C so has general signature # These enums derive from (int, IntEnum) or (str, Enum). See comment in py3_common.txt pstats.SortKey.__new__ tkinter.EventType.__new__ -builtins.memoryview.__iter__ # C type that implements __getitem__ -builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ -sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only -sqlite3.Binary.__iter__ # C type that implements __getitem__ -sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only collections.Coroutine.cr_await collections.Coroutine.cr_code collections.Coroutine.cr_frame @@ -166,10 +149,6 @@ unicodedata.UCD.is_normalized xml.parsers.expat.XMLParserType.SkippedEntityHandler xml.parsers.expat.XMLParserType.intern -# None on the class, but never None on instances -ast.FormattedValue.conversion -_ast.FormattedValue.conversion - # SpooledTemporaryFile implements IO except these methods before Python 3.11 # See also https://github.com/python/typeshed/pull/2452#issuecomment-420657918 tempfile.SpooledTemporaryFile.__next__ @@ -177,6 +156,10 @@ tempfile.SpooledTemporaryFile.readable tempfile.SpooledTemporaryFile.seekable tempfile.SpooledTemporaryFile.writable +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + # Side effects from module initialization _compat_pickle.excname email.contentmanager.maintype @@ -191,3 +174,28 @@ lib2to3.pgen2.grammar.op pydoc.Helper.symbol # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.symbols_ # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 pydoc.Helper.topic # Loop variable in class https://github.com/python/typeshed/issues/6401#issuecomment-981178522 + +# Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. +collections.Set.__rand__ +collections.Set.__ror__ +collections.Set.__rsub__ +collections.Set.__rxor__ + +builtins.memoryview.__iter__ # C type that implements __getitem__ +builtins.memoryview.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.dbapi2.Binary.__iter__ # C type that implements __getitem__ +sqlite3.dbapi2.Binary.cast # inspect.signature is incorrect about shape being kw-only +sqlite3.Binary.__iter__ # C type that implements __getitem__ +sqlite3.Binary.cast # inspect.signature is incorrect about shape being kw-only + +# C signature is broader than what is actually accepted +contextvars.Context.__init__ +queue.SimpleQueue.__init__ +xml.etree.ElementTree.XMLParser.__init__ +xml.etree.cElementTree.XMLParser.__init__ + +ast.FormattedValue.conversion # None on the class, but never None on instances +_ast.FormattedValue.conversion # None on the class, but never None on instances + +ftplib.FTP.trust_server_pasv_ipv4_address # Dangerous to use, intentionally undocumented, intentionally missing from typeshed. #6154 +os.PathLike.__class_getitem__ # PathLike is a protocol; we don't expect all PathLike classes to implement class_getitem diff --git a/tests/stubtest_allowlists/py3_common.txt b/tests/stubtest_allowlists/py3_common.txt index ac4b3f7fb..50765fff1 100644 --- a/tests/stubtest_allowlists/py3_common.txt +++ b/tests/stubtest_allowlists/py3_common.txt @@ -16,11 +16,13 @@ _collections_abc.Generator.gi_yieldfrom _collections_abc.Mapping.__reversed__ # set to None at runtime for a better error message _collections_abc.Mapping.get # Adding None to the Union messed up mypy _collections_abc.Sequence.index # Supporting None in end is not mandatory + # Adding these reflected dunders to `typing.AbstractSet` causes a large number of false-positives. See #7414. _collections_abc.Set.__rand__ _collections_abc.Set.__ror__ _collections_abc.Set.__rsub__ _collections_abc.Set.__rxor__ + _csv.Dialect.__init__ # C __init__ signature is inaccurate _socket.* _threading_local.local.__new__ @@ -183,7 +185,6 @@ ssl.PROTOCOL_SSLv2 # Defined only if compiled with ssl v2 ssl.Purpose.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple. ssl._ASN1Object.__new__ # You cannot override __new__ in NamedTuple and runtime uses namedtuple. subprocess.Popen.__init__ -sys.gettotalrefcount # Available on python debug builds sys.implementation # Actually SimpleNamespace but then you wouldn't have convenient attributes sys.thread_info tarfile.TarFile.errors # errors is initialized for some reason as None even though it really only accepts str @@ -236,9 +237,134 @@ webbrowser.UnixBrowser.remote_action_newtab # always overridden in inheriting c webbrowser.UnixBrowser.remote_action_newwin # always overridden in inheriting class xml.parsers.expat.expat_CAPI +# ========== +# Exists at runtime, but missing from stubs +# ========== +_json.encode_basestring +_thread.LockType.acquire_lock +_thread.LockType.locked_lock +_thread.LockType.release_lock +_thread.RLock +_thread.allocate +_thread.exit_thread +_thread.start_new +_threading_local._localimpl.localargs +_threading_local._localimpl.locallock +builtins.SyntaxError.print_file_and_line +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 +logging.config.BaseConfigurator +logging.config.ConvertingDict +logging.config.ConvertingList +logging.config.ConvertingMixin +logging.config.ConvertingTuple +logging.config.DictConfigurator +logging.config.dictConfigClass +mimetypes.MimeTypes.add_type +modulefinder.test +multiprocessing.managers.Server.accepter +multiprocessing.managers.Server.create +multiprocessing.managers.Server.debug_info +multiprocessing.managers.Server.decref +multiprocessing.managers.Server.dummy +multiprocessing.managers.Server.fallback_getvalue +multiprocessing.managers.Server.fallback_mapping +multiprocessing.managers.Server.fallback_repr +multiprocessing.managers.Server.fallback_str +multiprocessing.managers.Server.get_methods +multiprocessing.managers.Server.handle_request +multiprocessing.managers.Server.incref +multiprocessing.managers.Server.number_of_objects +multiprocessing.managers.Server.public +multiprocessing.managers.Server.serve_client +multiprocessing.managers.Server.shutdown +multiprocessing.managers.SyncManager.Barrier +multiprocessing.managers.SyncManager.JoinableQueue +multiprocessing.managers.SyncManager.Pool +multiprocessing.pool.Pool.Process +multiprocessing.pool.ThreadPool.Process +multiprocessing.synchronize.Semaphore.get_value +tkinter.Misc.config +tkinter.font.Font.counter +tkinter.simpledialog.Dialog.apply +tkinter.simpledialog.Dialog.cancel +tkinter.simpledialog.Dialog.ok +tkinter.simpledialog.Dialog.validate +tkinter.tix.CObjView +tkinter.tix.DialogShell +tkinter.tix.ExFileSelectDialog +tkinter.tix.FileSelectDialog +tkinter.tix.FileTypeList +tkinter.tix.Grid +tkinter.tix.NoteBookFrame +tkinter.tix.OptionName +tkinter.tix.ResizeHandle +tkinter.tix.ScrolledGrid +tkinter.tix.ScrolledHList +tkinter.tix.ScrolledListBox +tkinter.tix.ScrolledTList +tkinter.tix.ScrolledText +tkinter.tix.ScrolledWindow +tkinter.tix.Shell +turtle.TNavigator.speed + +# Undocumented implementation details of a deprecated class +importlib.machinery.WindowsRegistryFinder.DEBUG_BUILD +importlib.machinery.WindowsRegistryFinder.REGISTRY_KEY +importlib.machinery.WindowsRegistryFinder.REGISTRY_KEY_DEBUG + +# Undocumented implementation details +profile.Profile.dispatch +profile.Profile.fake_code +profile.Profile.fake_frame +profile.Profile.trace_dispatch +profile.Profile.trace_dispatch_c_call +profile.Profile.trace_dispatch_call +profile.Profile.trace_dispatch_exception +profile.Profile.trace_dispatch_i +profile.Profile.trace_dispatch_l +profile.Profile.trace_dispatch_mac +profile.Profile.trace_dispatch_return +cgi.FieldStorage.bufsize +cgi.FieldStorage.read_binary +cgi.FieldStorage.read_lines +cgi.FieldStorage.read_lines_to_eof +cgi.FieldStorage.read_lines_to_outerboundary +cgi.FieldStorage.read_multi +cgi.FieldStorage.read_single +cgi.FieldStorage.read_urlencoded +cgi.FieldStorage.skip_lines +email.contentmanager.get_and_fixup_unknown_message_content +email.contentmanager.get_message_content +email.contentmanager.get_non_text_content +email.contentmanager.get_text_content +email.contentmanager.set_bytes_content +email.contentmanager.set_message_content +email.contentmanager.set_text_content +pipes.Template.makepipeline +pipes.Template.open_r +pipes.Template.open_w +sunau.Au_read.initfp +sunau.Au_write.initfp +turtle.ScrolledCanvas.adjustScrolls +turtle.ScrolledCanvas.onResize +wave.Wave_read.initfp +wave.Wave_write.initfp + # ========== # Allowlist entries that cannot or should not be fixed # ========== + _collections_abc.AsyncGenerator.asend # async at runtime, deliberately not in the stub, see #7491. Pos-only differences also. _collections_abc.AsyncGenerator.__anext__ # async at runtime, deliberately not in the stub, see #7491 _collections_abc.AsyncGenerator.aclose # async at runtime, deliberately not in the stub, see #7491 @@ -246,19 +372,23 @@ _collections_abc.AsyncIterator.__anext__ # async at runtime, deliberately not i _pydecimal.* # See comments in file _weakref.ProxyType.__bytes__ # Doesn't really exist ast.NodeVisitor.visit_\w+ # Methods are discovered dynamically, see #3796 + # Weird special builtins that are typed as functions, but aren't functions builtins.copyright builtins.credits builtins.exit -builtins.float.__getformat__ # Internal method for CPython test suite builtins.help builtins.license builtins.quit + +builtins.float.__getformat__ # Internal method for CPython test suite + # These super() dunders don't seem to be particularly useful, # and having them pop up on autocomplete suggestions would be annoying builtins.super.__self__ builtins.super.__self_class__ builtins.super.__thisclass__ + # GetSetDescriptor that always raises AttributeError builtins.OSError.characters_written # Aliases for OSError @@ -268,36 +398,51 @@ dbm.dumb.error.characters_written os.error.characters_written select.error.characters_written socket.error.characters_written + 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 -# Dynamically specified by __getattr__, and thus don't exist on the class -tempfile._TemporaryFileWrapper.[\w_]+ +tempfile._TemporaryFileWrapper.[\w_]+ # Dynamically specified by __getattr__, and thus don't exist on the class + # stubtest incorrectly highlights the type argument as not having a default value. types.FunctionType.__get__ types.LambdaType.__get__ + # Various classes in typing aren't types at runtime. In addition, mypy thinks some special forms are tautologically defined. typing.[A-Z]\w+ typing_extensions\..* + +# Typing-related weirdness +_collections_abc.Callable +_typeshed.* # Utility types for typeshed, doesn't exist at runtime + +# Builtins that type checkers pretends exist +builtins.reveal_locals +builtins.reveal_type + # We can't distinguish not having a default value from having a default value of inspect.Parameter.empty inspect.Parameter.__init__ inspect.Signature.__init__ -# Any field can be set on Namespace -multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ + +multiprocessing.(dummy|managers).Namespace.__[gs]etattr__ # Any field can be set on Namespace + # sys attributes that are not always defined +sys.gettotalrefcount # Available on python debug builds sys.last_traceback sys.last_type sys.last_value sys.ps1 sys.ps2 sys.tracebacklimit + # See comments in file. List out methods that are delegated by __getattr__ at runtime. # Used to make the relevant class satisfy BinaryIO interface. codecs.StreamReaderWriter.\w+ codecs.StreamRecoder.\w+ urllib.response.addbase.\w+ + weakref.ProxyType.__bytes__ # Doesn't actually exist # Dynamically created, has unnecessary *args @@ -318,13 +463,6 @@ xml.dom.minidom.EMPTY_PREFIX xml.dom.minidom.XMLNS_NAMESPACE xml.dom.minidom.StringTypes -# Typing-related weirdness -_collections_abc.Callable -_typeshed.* # Utility types for typeshed, doesn't exist at runtime -# Builtins that type checkers pretends exist -builtins.reveal_locals -builtins.reveal_type - # __all__-related weirdness (see #6523) distutils.command.build distutils.command.build_py @@ -432,49 +570,6 @@ wsgiref.handlers.BaseHandler.headers_sent wsgiref.handlers.BaseHandler.result wsgiref.handlers.BaseHandler.status -# Undocumented implementation details of a deprecated class -importlib.machinery.WindowsRegistryFinder.DEBUG_BUILD -importlib.machinery.WindowsRegistryFinder.REGISTRY_KEY -importlib.machinery.WindowsRegistryFinder.REGISTRY_KEY_DEBUG - -# Undocumented implementation details -profile.Profile.dispatch -profile.Profile.fake_code -profile.Profile.fake_frame -profile.Profile.trace_dispatch -profile.Profile.trace_dispatch_c_call -profile.Profile.trace_dispatch_call -profile.Profile.trace_dispatch_exception -profile.Profile.trace_dispatch_i -profile.Profile.trace_dispatch_l -profile.Profile.trace_dispatch_mac -profile.Profile.trace_dispatch_return -cgi.FieldStorage.bufsize -cgi.FieldStorage.read_binary -cgi.FieldStorage.read_lines -cgi.FieldStorage.read_lines_to_eof -cgi.FieldStorage.read_lines_to_outerboundary -cgi.FieldStorage.read_multi -cgi.FieldStorage.read_single -cgi.FieldStorage.read_urlencoded -cgi.FieldStorage.skip_lines -email.contentmanager.get_and_fixup_unknown_message_content -email.contentmanager.get_message_content -email.contentmanager.get_non_text_content -email.contentmanager.get_text_content -email.contentmanager.set_bytes_content -email.contentmanager.set_message_content -email.contentmanager.set_text_content -pipes.Template.makepipeline -pipes.Template.open_r -pipes.Template.open_w -sunau.Au_read.initfp -sunau.Au_write.initfp -turtle.ScrolledCanvas.adjustScrolls -turtle.ScrolledCanvas.onResize -wave.Wave_read.initfp -wave.Wave_write.initfp - # ========== # Missing from deprecated modules # Any of these can be added if someone needs them @@ -664,84 +759,3 @@ pkgutil.ImpLoader.get_source pkgutil.ImpLoader.is_package pkgutil.ImpLoader.load_module pkgutil.ImpLoader.source - -# ========== -# Exists at runtime, but missing from stubs -# ========== -_json.encode_basestring -_thread.LockType.acquire_lock -_thread.LockType.locked_lock -_thread.LockType.release_lock -_thread.RLock -_thread.allocate -_thread.exit_thread -_thread.start_new -_threading_local._localimpl.localargs -_threading_local._localimpl.locallock -builtins.SyntaxError.print_file_and_line -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 -logging.config.BaseConfigurator -logging.config.ConvertingDict -logging.config.ConvertingList -logging.config.ConvertingMixin -logging.config.ConvertingTuple -logging.config.DictConfigurator -logging.config.dictConfigClass -mimetypes.MimeTypes.add_type -modulefinder.test -multiprocessing.managers.Server.accepter -multiprocessing.managers.Server.create -multiprocessing.managers.Server.debug_info -multiprocessing.managers.Server.decref -multiprocessing.managers.Server.dummy -multiprocessing.managers.Server.fallback_getvalue -multiprocessing.managers.Server.fallback_mapping -multiprocessing.managers.Server.fallback_repr -multiprocessing.managers.Server.fallback_str -multiprocessing.managers.Server.get_methods -multiprocessing.managers.Server.handle_request -multiprocessing.managers.Server.incref -multiprocessing.managers.Server.number_of_objects -multiprocessing.managers.Server.public -multiprocessing.managers.Server.serve_client -multiprocessing.managers.Server.shutdown -multiprocessing.managers.SyncManager.Barrier -multiprocessing.managers.SyncManager.JoinableQueue -multiprocessing.managers.SyncManager.Pool -multiprocessing.pool.Pool.Process -multiprocessing.pool.ThreadPool.Process -multiprocessing.synchronize.Semaphore.get_value -tkinter.Misc.config -tkinter.font.Font.counter -tkinter.simpledialog.Dialog.apply -tkinter.simpledialog.Dialog.cancel -tkinter.simpledialog.Dialog.ok -tkinter.simpledialog.Dialog.validate -tkinter.tix.CObjView -tkinter.tix.DialogShell -tkinter.tix.ExFileSelectDialog -tkinter.tix.FileSelectDialog -tkinter.tix.FileTypeList -tkinter.tix.Grid -tkinter.tix.NoteBookFrame -tkinter.tix.OptionName -tkinter.tix.ResizeHandle -tkinter.tix.ScrolledGrid -tkinter.tix.ScrolledHList -tkinter.tix.ScrolledListBox -tkinter.tix.ScrolledTList -tkinter.tix.ScrolledText -tkinter.tix.ScrolledWindow -tkinter.tix.Shell -turtle.TNavigator.speed diff --git a/tests/stubtest_allowlists/win32-py310.txt b/tests/stubtest_allowlists/win32-py310.txt index 922b76741..e28796267 100644 --- a/tests/stubtest_allowlists/win32-py310.txt +++ b/tests/stubtest_allowlists/win32-py310.txt @@ -1,8 +1,3 @@ -# pathlib methods that exist on Windows, but always raise NotImplementedError, -# so are omitted from the stub -pathlib.WindowsPath.is_mount -pathlib.Path.is_mount - # Exists at runtime, but missing from stubs _winapi.CreateFileMapping _winapi.MapViewOfFile @@ -16,3 +11,12 @@ distutils.command.build_ext.__warningregistry__ msvcrt.GetErrorMode socket.MsgFlag.MSG_ERRQUEUE subprocess.STARTUPINFO.copy + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# 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_allowlists/win32-py311.txt b/tests/stubtest_allowlists/win32-py311.txt index 7fc8a08ba..d13534422 100644 --- a/tests/stubtest_allowlists/win32-py311.txt +++ b/tests/stubtest_allowlists/win32-py311.txt @@ -1,11 +1,4 @@ -# pathlib methods that exist on Windows, but always raise NotImplementedError, -# so are omitted from the stub -pathlib.WindowsPath.is_mount -pathlib.Path.is_mount -os.EX_OK - -# Exists at runtime, but missing from stubs _winapi.CreateFileMapping _winapi.MapViewOfFile _winapi.OpenFileMapping @@ -18,5 +11,15 @@ asyncio.windows_events.IocpProactor.recvfrom_into asyncio.windows_events.IocpProactor.sendto distutils.command.build_ext.__warningregistry__ msvcrt.GetErrorMode +os.EX_OK socket.MsgFlag.MSG_ERRQUEUE subprocess.STARTUPINFO.copy + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# 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_allowlists/win32-py36.txt b/tests/stubtest_allowlists/win32-py36.txt index d6fd83f34..56ad9c50e 100644 --- a/tests/stubtest_allowlists/win32-py36.txt +++ b/tests/stubtest_allowlists/win32-py36.txt @@ -7,13 +7,17 @@ cgi.parse urllib.parse.parse_qs urllib.parse.parse_qsl -# pathlib methods that exist on Windows, but always raise NotImplementedError, -# so are omitted from the stub -pathlib.WindowsPath.group -pathlib.WindowsPath.owner - hashlib.scrypt os.startfile # Exists at runtime, but missing from stubs venv.EnvBuilder.include_binary + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# pathlib methods that exist on Windows, but always raise NotImplementedError, +# so are omitted from the stub +pathlib.WindowsPath.group +pathlib.WindowsPath.owner diff --git a/tests/stubtest_allowlists/win32-py37.txt b/tests/stubtest_allowlists/win32-py37.txt index 0ab3ff7e0..a57fb445a 100644 --- a/tests/stubtest_allowlists/win32-py37.txt +++ b/tests/stubtest_allowlists/win32-py37.txt @@ -8,14 +8,18 @@ cgi.parse_multipart urllib.parse.parse_qs urllib.parse.parse_qsl +os.startfile + +# Exists at runtime, but missing from stubs +socket.MsgFlag.MSG_ERRQUEUE + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + # pathlib methods that exist on Windows, but always raise NotImplementedError, # so are omitted from the stub pathlib.WindowsPath.group pathlib.WindowsPath.owner pathlib.Path.is_mount pathlib.WindowsPath.is_mount - -os.startfile - -# Exists at runtime, but missing from stubs -socket.MsgFlag.MSG_ERRQUEUE diff --git a/tests/stubtest_allowlists/win32-py38.txt b/tests/stubtest_allowlists/win32-py38.txt index bae39db29..ecb7cd493 100644 --- a/tests/stubtest_allowlists/win32-py38.txt +++ b/tests/stubtest_allowlists/win32-py38.txt @@ -1,10 +1,3 @@ -# pathlib methods that exist on Windows, but always raise NotImplementedError, -# so are omitted from the stub -pathlib.WindowsPath.group -pathlib.WindowsPath.owner -pathlib.Path.is_mount -pathlib.WindowsPath.is_mount - # Exists at runtime, but missing from stubs _winapi.CreateFileMapping _winapi.MapViewOfFile @@ -16,3 +9,14 @@ asyncio.windows_events.IocpProactor.recvfrom asyncio.windows_events.IocpProactor.sendto socket.MsgFlag.MSG_ERRQUEUE subprocess.STARTUPINFO.copy + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# pathlib methods that exist on Windows, but always raise NotImplementedError, +# so are omitted from the stub +pathlib.WindowsPath.group +pathlib.WindowsPath.owner +pathlib.Path.is_mount +pathlib.WindowsPath.is_mount diff --git a/tests/stubtest_allowlists/win32-py39.txt b/tests/stubtest_allowlists/win32-py39.txt index f8e07f9fd..ccabd9845 100644 --- a/tests/stubtest_allowlists/win32-py39.txt +++ b/tests/stubtest_allowlists/win32-py39.txt @@ -1,8 +1,3 @@ -# pathlib methods that exist on Windows, but always raise NotImplementedError, -# so are omitted from the stub -pathlib.Path.is_mount -pathlib.WindowsPath.is_mount - # Exists at runtime, but missing from stubs _winapi.CreateFileMapping _winapi.MapViewOfFile @@ -14,3 +9,12 @@ asyncio.windows_events.IocpProactor.recvfrom asyncio.windows_events.IocpProactor.sendto socket.MsgFlag.MSG_ERRQUEUE subprocess.STARTUPINFO.copy + +# ========== +# Allowlist entries that cannot or should not be fixed +# ========== + +# 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_allowlists/win32.txt b/tests/stubtest_allowlists/win32.txt index ec7c2a84c..1a75c8d30 100644 --- a/tests/stubtest_allowlists/win32.txt +++ b/tests/stubtest_allowlists/win32.txt @@ -7,7 +7,7 @@ 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 -# alias for a class defined elsewhere, +# alias for a class defined elsewhere, # mypy infers the variable has type `(*args) -> DupHandle` but stubtest infers the runtime type as multiprocessing.reduction.AbstractReducer.DupHandle msilib.MSI[A-Z_]+ @@ -21,6 +21,20 @@ signal.SIGINFO winsound.SND_APPLICATION xmlrpc.server.fcntl +# 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 +socket.MsgFlag.MSG_BCAST +socket.MsgFlag.MSG_MCAST +ssl.SSLSocket.recvmsg +ssl.SSLSocket.recvmsg_into +ssl.SSLSocket.sendmsg +winreg.HKEYType.handle + + # ========== # Allowlist entries that cannot or should not be fixed # ========== @@ -62,16 +76,3 @@ tty # pathlib functions that rely on modules that don't exist on Windows pathlib.Path.owner pathlib.Path.group - -# 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 -socket.MsgFlag.MSG_BCAST -socket.MsgFlag.MSG_MCAST -ssl.SSLSocket.recvmsg -ssl.SSLSocket.recvmsg_into -ssl.SSLSocket.sendmsg -winreg.HKEYType.handle