Replace str with bytes for imaplib append and ParseFlags (#8130)

Last Argument of APPEND
https://github.com/python/cpython/blob/main/Lib/imaplib.py#L1497
https://github.com/python/cpython/blob/main/Lib/imaplib.py#L413
You can see it's parsed with the bytes regex MapCLRF re.compile(br'\r\n|\r|\n')

https://github.com/python/cpython/blob/main/Lib/imaplib.py#L1497
You can see it's parsed with the bytes regex Flags
re.compile(br'.*FLAGS \((?P<flags>[^\)]*)\)')
This commit is contained in:
Theo Belaire
2022-06-21 15:16:36 -04:00
committed by GitHub
parent 3fe1f5d6c4
commit 73ec67587c

View File

@@ -55,7 +55,7 @@ class IMAP4:
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: str) -> str: ...
def append(self, mailbox: str, flags: str, date_time: str, message: bytes) -> str: ...
def authenticate(self, mechanism: str, authobject: Callable[[bytes], bytes | None]) -> tuple[str, str]: ...
def capability(self) -> _CommandResults: ...
def check(self) -> _CommandResults: ...
@@ -171,5 +171,5 @@ class _Authenticator:
def Internaldate2tuple(resp: bytes) -> time.struct_time: ...
def Int2AP(num: int) -> str: ...
def ParseFlags(resp: str) -> tuple[str, ...]: ...
def ParseFlags(resp: bytes) -> tuple[bytes, ...]: ...
def Time2Internaldate(date_time: float | time.struct_time | str) -> str: ...