email.mime.application.MIMEApplication expects data to be bytes, while it should be Union[str, bytes] (#2855)

Fixes #2831
This commit is contained in:
Vasily Zakharov
2019-03-11 22:42:55 +03:00
committed by Sebastian Rittau
parent e4e19d6e98
commit 34cc5545fe
3 changed files with 3 additions and 3 deletions

View File

@@ -6,6 +6,6 @@ from email.mime.nonmultipart import MIMENonMultipart
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
class MIMEApplication(MIMENonMultipart):
def __init__(self, _data: bytes, _subtype: str = ...,
def __init__(self, _data: Union[str, bytes], _subtype: str = ...,
_encoder: Callable[[MIMEApplication], None] = ...,
**_params: _ParamsType) -> None: ...

View File

@@ -6,6 +6,6 @@ from email.mime.nonmultipart import MIMENonMultipart
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
class MIMEAudio(MIMENonMultipart):
def __init__(self, _audiodata: bytes, _subtype: Optional[str] = ...,
def __init__(self, _audiodata: Union[str, bytes], _subtype: Optional[str] = ...,
_encoder: Callable[[MIMEAudio], None] = ...,
**_params: _ParamsType) -> None: ...

View File

@@ -6,6 +6,6 @@ from email.mime.nonmultipart import MIMENonMultipart
_ParamsType = Union[str, None, Tuple[str, Optional[str], str]]
class MIMEImage(MIMENonMultipart):
def __init__(self, _imagedata: bytes, _subtype: Optional[str] = ...,
def __init__(self, _imagedata: Union[str, bytes], _subtype: Optional[str] = ...,
_encoder: Callable[[MIMEImage], None] = ...,
**_params: _ParamsType) -> None: ...