Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

adjusting socketserver.BaseServer #13082

Draft
wants to merge 1 commit into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 3 additions & 3 deletions stdlib/@tests/stubtest_allowlists/common.txt
Original file line number Diff line number Diff line change
Expand Up @@ -61,9 +61,6 @@ pickle.Pickler.reducer_override # implemented in C pickler
select.poll # Depends on configuration
selectors.DevpollSelector # Depends on configuration
shutil.rmtree # stubtest doesn't like that we have this as an instance of a callback protocol instead of a function
socketserver.BaseServer.fileno # implemented in derived classes
socketserver.BaseServer.get_request # implemented in derived classes
socketserver.BaseServer.server_bind # implemented in derived classes
ssl.Purpose.__new__ # the multiple inheritance confuses mypy
tarfile.TarFile.errors # errors is initialized for some reason as None even though it really only accepts str
tkinter.simpledialog.[A-Z_]+
Expand Down Expand Up @@ -435,6 +432,9 @@ multiprocessing.pool.Pool.__del__
# C signature is broader than what is actually accepted
_?queue.SimpleQueue.__init__

# Not implemented, but expected to exist on subclasses.
socketserver.BaseServer.get_request

# Items that depend on the existence and flags of SSL
imaplib.IMAP4_SSL.ssl
ssl.PROTOCOL_SSLv2
Expand Down
6 changes: 3 additions & 3 deletions stdlib/socketserver.pyi
Original file line number Diff line number Diff line change
Expand Up @@ -49,18 +49,16 @@ class BaseServer:
def __init__(
self, server_address: _Address, RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler]
) -> None: ...
def fileno(self) -> int: ...
def handle_request(self) -> None: ...
def serve_forever(self, poll_interval: float = 0.5) -> None: ...
def shutdown(self) -> None: ...
def server_close(self) -> None: ...
def finish_request(self, request: _RequestType, client_address: _RetAddress) -> None: ...
def get_request(self) -> tuple[Any, Any]: ...
def get_request(self) -> tuple[Any, Any]: ... # Not implemented here, but expected to exist on subclasses
def handle_error(self, request: _RequestType, client_address: _RetAddress) -> None: ...
def handle_timeout(self) -> None: ...
def process_request(self, request: _RequestType, client_address: _RetAddress) -> None: ...
def server_activate(self) -> None: ...
def server_bind(self) -> None: ...
def verify_request(self, request: _RequestType, client_address: _RetAddress) -> bool: ...
def __enter__(self) -> Self: ...
def __exit__(
Expand All @@ -80,7 +78,9 @@ class TCPServer(BaseServer):
RequestHandlerClass: Callable[[Any, _RetAddress, Self], BaseRequestHandler],
bind_and_activate: bool = True,
) -> None: ...
def fileno(self) -> int: ...
def get_request(self) -> tuple[_socket, _RetAddress]: ...
def server_bind(self) -> None: ...

class UDPServer(TCPServer):
max_packet_size: ClassVar[int]
Expand Down