forked from platypush/platypush
Open the source file in read non-binary mode in case of MIMEText
This commit is contained in:
parent
6dce4c59f6
commit
8a1f49a906
1 changed files with 4 additions and 1 deletions
|
@ -170,9 +170,12 @@ class MailOutPlugin(MailPlugin, ABC):
|
||||||
|
|
||||||
args = {}
|
args = {}
|
||||||
if _type_class != MIMEText:
|
if _type_class != MIMEText:
|
||||||
|
mode = 'rb'
|
||||||
args['Name'] = os.path.basename(file)
|
args['Name'] = os.path.basename(file)
|
||||||
|
else:
|
||||||
|
mode = 'r'
|
||||||
|
|
||||||
with open(file, 'rb') as f:
|
with open(file, mode) as f:
|
||||||
return _type_class(f.read(), _subtype, **args)
|
return _type_class(f.read(), _subtype, **args)
|
||||||
|
|
||||||
@classmethod
|
@classmethod
|
||||||
|
|
Loading…
Reference in a new issue