mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2024-12-27 09:08:53 +01:00
Fixed encoding error in get_email
This commit is contained in:
parent
db223abe27
commit
7386a45784
@ -323,7 +323,10 @@ def ticket_from_message(message, queue, logger):
|
||||
decodeUnknown(part.get_content_charset(), part.get_payload(decode=True))
|
||||
)
|
||||
# workaround to get unicode text out rather than escaped text
|
||||
body = body.encode('ascii').decode('unicode_escape') if six.PY3 else body.encode('utf-8')
|
||||
try:
|
||||
body = body.encode('ascii').decode('unicode_escape')
|
||||
except UnicodeEncodeError:
|
||||
body.encode('utf-8')
|
||||
logger.debug("Discovered plain text MIME part")
|
||||
else:
|
||||
files.append(
|
||||
|
Loading…
Reference in New Issue
Block a user