From 70010cba57f4b979547461a145355930ea6bb9ce Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 19:42:19 +0000 Subject: [PATCH 01/11] Update plistlib.pyi --- stdlib/plistlib.pyi | 12 ++++++++++-- 1 file changed, 10 insertions(+), 2 deletions(-) diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index 3f19eeeb6fc5..6549cd3cb8dd 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import Self +from _typeshed import BytesPath, Self from datetime import datetime from enum import Enum from typing import IO, Any, Mapping, MutableMapping @@ -105,11 +105,19 @@ if sys.version_info < (3, 9): def writePlistToBytes(value: Mapping[str, Any]) -> bytes: ... if sys.version_info < (3, 7): - class Dict(dict[str, Any]): + class _InternalDict(dict[str, Any]): def __getattr__(self, attr: str) -> Any: ... def __setattr__(self, attr: str, value: Any) -> None: ... def __delattr__(self, attr: str) -> None: ... + class Dict(_InternalDict): ... # deprecated + + class Plist(_InternalDict): # deprecated + @classmethod + def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[Bytes]) -> Self: ... + def wrife(self, pathOrFile: BytesPath | IO[Bytes]) -> None: ... + + if sys.version_info < (3, 9): class Data: data: bytes From 220b039ccc93fce8d6957b042db85ea8e612c078 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 19:49:43 +0000 Subject: [PATCH 02/11] Update server.pyi --- stdlib/http/server.pyi | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/stdlib/http/server.pyi b/stdlib/http/server.pyi index 0512ab5f739f..dd64fedf941d 100644 --- a/stdlib/http/server.pyi +++ b/stdlib/http/server.pyi @@ -11,9 +11,8 @@ class HTTPServer(socketserver.TCPServer): server_name: str server_port: int -if sys.version_info >= (3, 7): - class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): - daemon_threads: bool # undocumented +class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): + daemon_threads: bool # undocumented class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): client_address: tuple[str, int] From 6e6437ce6987d3913175b13a601cd405381d4454 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 19:52:54 +0000 Subject: [PATCH 03/11] Update __init__.pyi --- stdlib/multiprocessing/__init__.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/multiprocessing/__init__.pyi b/stdlib/multiprocessing/__init__.pyi index 979176c47a5e..e011349c5690 100644 --- a/stdlib/multiprocessing/__init__.pyi +++ b/stdlib/multiprocessing/__init__.pyi @@ -102,7 +102,6 @@ else: "get_logger", "get_start_method", "log_to_stderr", - "parent_process", "reducer", "set_executable", "set_forkserver_preload", From 53892b0bcb9dcb181379bf1866e3c129e124e133 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 19:54:56 +0000 Subject: [PATCH 04/11] Update tasks.pyi --- stdlib/asyncio/tasks.pyi | 1 - 1 file changed, 1 deletion(-) diff --git a/stdlib/asyncio/tasks.pyi b/stdlib/asyncio/tasks.pyi index 765fb67beefb..9acb96b91820 100644 --- a/stdlib/asyncio/tasks.pyi +++ b/stdlib/asyncio/tasks.pyi @@ -43,7 +43,6 @@ else: "wait_for", "as_completed", "sleep", - "async", "gather", "shield", "ensure_future", From f5f3b62c9257588e589a7fc57deb8d45d2785d2c Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:01:43 +0000 Subject: [PATCH 05/11] Update py36.txt --- tests/stubtest_allowlists/py36.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/stubtest_allowlists/py36.txt b/tests/stubtest_allowlists/py36.txt index 2b3413ea7ed8..a1b05524810c 100644 --- a/tests/stubtest_allowlists/py36.txt +++ b/tests/stubtest_allowlists/py36.txt @@ -121,7 +121,6 @@ html.parser.HTMLParser.unescape platform.popen plistlib.Data.asBase64 plistlib.Data.fromBase64 -plistlib.Plist ssl.SSLObject.verify_client_post_handshake ssl.SSLSocket.verify_client_post_handshake sys.callstats From a0d6e6bb3d5ddbb1a1a2868475aaca8f4ba0b191 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:05:54 +0000 Subject: [PATCH 06/11] Update plistlib.pyi --- stdlib/plistlib.pyi | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index 6549cd3cb8dd..fafc817dd46f 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -114,8 +114,8 @@ if sys.version_info < (3, 7): class Plist(_InternalDict): # deprecated @classmethod - def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[Bytes]) -> Self: ... - def wrife(self, pathOrFile: BytesPath | IO[Bytes]) -> None: ... + def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[bytes]) -> Self: ... + def wrife(self, pathOrFile: BytesPath | IO[bytes]) -> None: ... if sys.version_info < (3, 9): From d72b898c14f28f996ce83375ca10e44a7cc674fc Mon Sep 17 00:00:00 2001 From: "pre-commit-ci[bot]" <66853113+pre-commit-ci[bot]@users.noreply.github.com> Date: Tue, 22 Feb 2022 20:07:15 +0000 Subject: [PATCH 07/11] [pre-commit.ci] auto fixes from pre-commit.com hooks --- stdlib/plistlib.pyi | 3 +-- 1 file changed, 1 insertion(+), 2 deletions(-) diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index fafc817dd46f..567a68034fa1 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -111,12 +111,11 @@ if sys.version_info < (3, 7): def __delattr__(self, attr: str) -> None: ... class Dict(_InternalDict): ... # deprecated - + class Plist(_InternalDict): # deprecated @classmethod def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[bytes]) -> Self: ... def wrife(self, pathOrFile: BytesPath | IO[bytes]) -> None: ... - if sys.version_info < (3, 9): class Data: From d312ef38e0e741400f821e96cdaa9d3861e9f3d2 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:11:39 +0000 Subject: [PATCH 08/11] Update plistlib.pyi --- stdlib/plistlib.pyi | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index 567a68034fa1..bdfbd7ecb034 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -110,9 +110,11 @@ if sys.version_info < (3, 7): def __setattr__(self, attr: str, value: Any) -> None: ... def __delattr__(self, attr: str) -> None: ... - class Dict(_InternalDict): ... # deprecated + class Dict(_InternalDict): # deprecated + def __init__(self, **kwargs: Any) -> None: ... class Plist(_InternalDict): # deprecated + def __init__(self, **kwargs: Any) -> None: ... @classmethod def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[bytes]) -> Self: ... def wrife(self, pathOrFile: BytesPath | IO[bytes]) -> None: ... From adb7d654a4a0b753332dbb70811a76736246f3fa Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:15:13 +0000 Subject: [PATCH 09/11] Update plistlib.pyi --- stdlib/plistlib.pyi | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/stdlib/plistlib.pyi b/stdlib/plistlib.pyi index bdfbd7ecb034..67d1611de828 100644 --- a/stdlib/plistlib.pyi +++ b/stdlib/plistlib.pyi @@ -1,5 +1,5 @@ import sys -from _typeshed import BytesPath, Self +from _typeshed import Self from datetime import datetime from enum import Enum from typing import IO, Any, Mapping, MutableMapping @@ -116,8 +116,8 @@ if sys.version_info < (3, 7): class Plist(_InternalDict): # deprecated def __init__(self, **kwargs: Any) -> None: ... @classmethod - def fromFile(cls: type[Self], pathOrFile: BytesPath | IO[bytes]) -> Self: ... - def wrife(self, pathOrFile: BytesPath | IO[bytes]) -> None: ... + def fromFile(cls: type[Self], pathOrFile: str | IO[bytes]) -> Self: ... + def write(self, pathOrFile: str | IO[bytes]) -> None: ... if sys.version_info < (3, 9): class Data: From 9a8b5bd186e7ee95fa763d4d2cce9f4ba1ed515b Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:17:40 +0000 Subject: [PATCH 10/11] Update server.pyi --- stdlib/http/server.pyi | 10 +++++++--- 1 file changed, 7 insertions(+), 3 deletions(-) diff --git a/stdlib/http/server.pyi b/stdlib/http/server.pyi index dd64fedf941d..53159b65ec14 100644 --- a/stdlib/http/server.pyi +++ b/stdlib/http/server.pyi @@ -5,14 +5,18 @@ import sys from _typeshed import StrPath, SupportsRead, SupportsWrite from typing import Any, AnyStr, BinaryIO, ClassVar, Mapping, Sequence -__all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"] +if sys.version_info >= (3, 7): + __all__ = ["HTTPServer", "ThreadingHTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"] +else: + __all__ = ["HTTPServer", "BaseHTTPRequestHandler", "SimpleHTTPRequestHandler", "CGIHTTPRequestHandler"] class HTTPServer(socketserver.TCPServer): server_name: str server_port: int -class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): - daemon_threads: bool # undocumented +if sys.version_info >= (3, 7): + class ThreadingHTTPServer(socketserver.ThreadingMixIn, HTTPServer): + daemon_threads: bool # undocumented class BaseHTTPRequestHandler(socketserver.StreamRequestHandler): client_address: tuple[str, int] From 0c8b56fd298f0c5b29873e4b71e622491c74ee34 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 22 Feb 2022 20:20:41 +0000 Subject: [PATCH 11/11] Update py36.txt --- tests/stubtest_allowlists/py36.txt | 1 - 1 file changed, 1 deletion(-) diff --git a/tests/stubtest_allowlists/py36.txt b/tests/stubtest_allowlists/py36.txt index a1b05524810c..1c70b102c2ea 100644 --- a/tests/stubtest_allowlists/py36.txt +++ b/tests/stubtest_allowlists/py36.txt @@ -31,7 +31,6 @@ ipaddress._BaseNetwork.__init__ json.loads mmap.ACCESS_DEFAULT (os|posix).utime -plistlib.Dict.__init__ pyexpat.XMLParserType.ExternalEntityParserCreate # C signature is wrong - function gets only positional args random.Random.randrange # missing undocumented arg _int random.randrange # missing undocumented arg _int