Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

imaplib: fix bytes usage #9021

Merged
merged 5 commits into from
Oct 28, 2022
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
14 changes: 7 additions & 7 deletions stdlib/imaplib.pyi
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
import subprocess
import sys
import time
from _typeshed import Self
from _typeshed import ReadableBuffer, Self
from builtins import list as _list # conflicts with a method named "list"
from collections.abc import Callable
from datetime import datetime
from re import Pattern
from socket import socket as _socket
from ssl import SSLContext, SSLSocket
from types import TracebackType
from typing import IO, Any
from typing import IO, Any, SupportsAbs, SupportsInt
from typing_extensions import Literal, TypeAlias

__all__ = ["IMAP4", "IMAP4_stream", "Internaldate2tuple", "Int2AP", "ParseFlags", "Time2Internaldate", "IMAP4_SSL"]
Expand Down Expand Up @@ -54,12 +54,12 @@ class IMAP4:
file: IO[str] | IO[bytes]
def read(self, size: int) -> bytes: ...
def readline(self) -> bytes: ...
def send(self, data: bytes) -> None: ...
def send(self, data: ReadableBuffer) -> None: ...
def shutdown(self) -> None: ...
def socket(self) -> _socket: ...
def recent(self) -> _CommandResults: ...
def response(self, code: str) -> _CommandResults: ...
def append(self, mailbox: str, flags: str, date_time: str, message: bytes) -> str: ...
def append(self, mailbox: str, flags: str, date_time: str, message: ReadableBuffer) -> str: ...
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
def capability(self) -> _CommandResults: ...
def check(self) -> _CommandResults: ...
Expand Down Expand Up @@ -157,7 +157,7 @@ class _Authenticator:
def encode(self, inp: bytes) -> str: ...
def decode(self, inp: str) -> bytes: ...

def Internaldate2tuple(resp: bytes) -> time.struct_time: ...
def Int2AP(num: int) -> str: ...
def ParseFlags(resp: bytes) -> tuple[bytes, ...]: ...
def Internaldate2tuple(resp: ReadableBuffer) -> time.struct_time | None: ...
def Int2AP(num: SupportsAbs[SupportsInt]) -> bytes: ...
def ParseFlags(resp: ReadableBuffer) -> tuple[bytes, ...]: ...
def Time2Internaldate(date_time: float | time.struct_time | time._TimeTuple | datetime | str) -> str: ...