From 1dc1c91429b921e6444c677b9197d5b3f5b0f064 Mon Sep 17 00:00:00 2001 From: Alex Waygood Date: Tue, 2 Aug 2022 17:20:07 +0100 Subject: [PATCH] `io.IOBase`: correct metaclass (#8468) `io.IOBase` has `ABCMeta` as the metaclass at runtime: https://github.com/python/cpython/blob/75a6441718dcbc65d993c9544e67e25bef120e82/Lib/io.py#L71 But not currently in the stub. This is causing an unexpected stubtest failure for a `urllib3` PR here: https://github.com/python/typeshed/runs/7633083101?check_suite_focus=true --- stdlib/io.pyi | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stdlib/io.pyi b/stdlib/io.pyi index c92fe1644..f47a9ddf3 100644 --- a/stdlib/io.pyi +++ b/stdlib/io.pyi @@ -1,3 +1,4 @@ +import abc import builtins import codecs import sys @@ -47,7 +48,7 @@ BlockingIOError = builtins.BlockingIOError class UnsupportedOperation(OSError, ValueError): ... -class IOBase: +class IOBase(metaclass=abc.ABCMeta): def __iter__(self) -> Iterator[bytes]: ... def __next__(self) -> bytes: ... def __enter__(self: Self) -> Self: ...