1- from collections .abc import Callable , Mapping
1+ from _typeshed import SupportsItems
2+ from collections .abc import Callable
23from logging import Logger
34from threading import Condition , Event , Lock
45from typing import Any , TypeVar
56from typing_extensions import Literal
67
78from paramiko .buffered_pipe import BufferedPipe
89from paramiko .file import BufferedFile
10+ from paramiko .message import _LikeBytes
911from paramiko .transport import Transport
1012from paramiko .util import ClosingContextManager
1113
@@ -43,22 +45,22 @@ class Channel(ClosingContextManager):
4345 def __init__ (self , chanid : int ) -> None : ...
4446 def __del__ (self ) -> None : ...
4547 def get_pty (
46- self , term : str | bytes = "vt100" , width : int = 80 , height : int = 24 , width_pixels : int = 0 , height_pixels : int = 0
48+ self , term : _LikeBytes = "vt100" , width : int = 80 , height : int = 24 , width_pixels : int = 0 , height_pixels : int = 0
4749 ) -> None : ...
4850 def invoke_shell (self ) -> None : ...
49- def exec_command (self , command : str | bytes ) -> None : ...
50- def invoke_subsystem (self , subsystem : str | bytes ) -> None : ...
51+ def exec_command (self , command : _LikeBytes ) -> None : ...
52+ def invoke_subsystem (self , subsystem : _LikeBytes ) -> None : ...
5153 def resize_pty (self , width : int = 80 , height : int = 24 , width_pixels : int = 0 , height_pixels : int = 0 ) -> None : ...
52- def update_environment (self , environment : Mapping [ str | bytes , str | bytes ]) -> None : ...
53- def set_environment_variable (self , name : str | bytes , value : str | bytes ) -> None : ...
54+ def update_environment (self , environment : SupportsItems [ _LikeBytes , _LikeBytes ]) -> None : ...
55+ def set_environment_variable (self , name : _LikeBytes , value : _LikeBytes ) -> None : ...
5456 def exit_status_ready (self ) -> bool : ...
5557 def recv_exit_status (self ) -> int : ...
5658 def send_exit_status (self , status : int ) -> None : ...
5759 def request_x11 (
5860 self ,
5961 screen_number : int = 0 ,
60- auth_protocol : str | bytes | None = None ,
61- auth_cookie : str | bytes | None = None ,
62+ auth_protocol : _LikeBytes | None = None ,
63+ auth_cookie : _LikeBytes | None = None ,
6264 single_connection : bool = False ,
6365 handler : Callable [[Channel , tuple [str , int ]], object ] | None = None ,
6466 ) -> bytes : ...
@@ -78,10 +80,10 @@ class Channel(ClosingContextManager):
7880 def recv_stderr_ready (self ) -> bool : ...
7981 def recv_stderr (self , nbytes : int ) -> bytes : ...
8082 def send_ready (self ) -> bool : ...
81- def send (self , s : bytes ) -> int : ...
82- def send_stderr (self , s : bytes ) -> int : ...
83- def sendall (self , s : bytes ) -> None : ...
84- def sendall_stderr (self , s : bytes ) -> None : ...
83+ def send (self , s : bytes | bytearray ) -> int : ...
84+ def send_stderr (self , s : bytes | bytearray ) -> int : ...
85+ def sendall (self , s : bytes | bytearray ) -> None : ...
86+ def sendall_stderr (self , s : bytes | bytearray ) -> None : ...
8587 def makefile (self , * params : Any ) -> ChannelFile : ...
8688 def makefile_stderr (self , * params : Any ) -> ChannelStderrFile : ...
8789 def makefile_stdin (self , * params : Any ) -> ChannelStdinFile : ...
0 commit comments