str(subject) may not be ascii

This commit is contained in:
sigoa 2018-03-26 21:37:23 +02:00 committed by GitHub
parent 73ebad4a4e
commit f8b1ea2cee
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 1 additions and 1 deletions

View File

@ -131,7 +131,7 @@ class BMAccount(object):
self.toAddress = toAddress
self.fromAddress = fromAddress
if isinstance(subject, unicode):
self.subject = str(subject)
self.subject = subject.encode('utf-8', 'ignore').decode('utf-8') #### str(subject) not ascii
else:
self.subject = subject
self.message = message