From 7b18a0be917b5a253b7d78fa3569c461c9a9a226 Mon Sep 17 00:00:00 2001 From: Andrey Rakhmatullin Date: Mon, 6 Nov 2023 17:31:50 +0400 Subject: [PATCH] Fix type hint for xml.sax.saxutils.XMLGenerator.__init__(). (#10979) The `out` parameter accepts objects with `write(__o: bytes)`, not `write(__o: str)` methods. --- stdlib/xml/sax/saxutils.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stdlib/xml/sax/saxutils.pyi b/stdlib/xml/sax/saxutils.pyi index 06e03a1e4..528f35963 100644 --- a/stdlib/xml/sax/saxutils.pyi +++ b/stdlib/xml/sax/saxutils.pyi @@ -11,7 +11,7 @@ def quoteattr(data: str, entities: Mapping[str, str] = {}) -> str: ... class XMLGenerator(handler.ContentHandler): def __init__( self, - out: TextIOBase | RawIOBase | StreamWriter | StreamReaderWriter | SupportsWrite[str] | None = None, + out: TextIOBase | RawIOBase | StreamWriter | StreamReaderWriter | SupportsWrite[bytes] | None = None, encoding: str = "iso-8859-1", short_empty_elements: bool = False, ) -> None: ...