1
- from collections .abc import Callable , Mapping
1
+ from _typeshed import SupportsItems
2
+ from collections .abc import Callable
2
3
from logging import Logger
3
4
from threading import Condition , Event , Lock
4
5
from typing import Any , TypeVar
5
6
from typing_extensions import Literal
6
7
7
8
from paramiko .buffered_pipe import BufferedPipe
8
9
from paramiko .file import BufferedFile
10
+ from paramiko .message import _LikeBytes
9
11
from paramiko .transport import Transport
10
12
from paramiko .util import ClosingContextManager
11
13
@@ -43,22 +45,22 @@ class Channel(ClosingContextManager):
43
45
def __init__ (self , chanid : int ) -> None : ...
44
46
def __del__ (self ) -> None : ...
45
47
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
47
49
) -> None : ...
48
50
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 : ...
51
53
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 : ...
54
56
def exit_status_ready (self ) -> bool : ...
55
57
def recv_exit_status (self ) -> int : ...
56
58
def send_exit_status (self , status : int ) -> None : ...
57
59
def request_x11 (
58
60
self ,
59
61
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 ,
62
64
single_connection : bool = False ,
63
65
handler : Callable [[Channel , tuple [str , int ]], object ] | None = None ,
64
66
) -> bytes : ...
@@ -78,10 +80,10 @@ class Channel(ClosingContextManager):
78
80
def recv_stderr_ready (self ) -> bool : ...
79
81
def recv_stderr (self , nbytes : int ) -> bytes : ...
80
82
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 : ...
85
87
def makefile (self , * params : Any ) -> ChannelFile : ...
86
88
def makefile_stderr (self , * params : Any ) -> ChannelStderrFile : ...
87
89
def makefile_stdin (self , * params : Any ) -> ChannelStdinFile : ...
0 commit comments