From 243472c9fdaeaa3e3c062cb805fe5bd04b7edabb Mon Sep 17 00:00:00 2001 From: Steve B Date: Mon, 1 Feb 2021 14:28:22 +0100 Subject: [PATCH] Correct return type BufferedFile.read in paramiko (#4994) According to the docs in paramiko the return type will always be bytes ``` .. note:: ``'b'`` mode flag is ignored (``self.FLAG_BINARY`` in ``self._flags``), because SSH treats all files as binary, since we have no idea what encoding the file is in, or even if the file is text data. :param int size: maximum number of bytes to read :returns: data read from the file (as bytes), or an empty string if EOF was encountered immediately ``` --- stubs/paramiko/paramiko/file.pyi | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/stubs/paramiko/paramiko/file.pyi b/stubs/paramiko/paramiko/file.pyi index 112b38d83..e462f1fa0 100644 --- a/stubs/paramiko/paramiko/file.pyi +++ b/stubs/paramiko/paramiko/file.pyi @@ -26,7 +26,7 @@ class BufferedFile(ClosingContextManager, Generic[AnyStr]): def writable(self) -> bool: ... def seekable(self) -> bool: ... def readinto(self, buff: bytearray) -> int: ... - def read(self, size: Optional[int] = ...) -> AnyStr: ... + def read(self, size: Optional[int] = ...) -> bytes: ... def readline(self, size: Optional[int] = ...) -> AnyStr: ... def readlines(self, sizehint: Optional[int] = ...) -> List[AnyStr]: ... def seek(self, offset: int, whence: int = ...) -> None: ...