mirror of
https://gitea.mueller.network/extern/django-helpdesk.git
synced 2025-01-14 01:48:40 +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))
|
decodeUnknown(part.get_content_charset(), part.get_payload(decode=True))
|
||||||
)
|
)
|
||||||
# workaround to get unicode text out rather than escaped text
|
# 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")
|
logger.debug("Discovered plain text MIME part")
|
||||||
else:
|
else:
|
||||||
files.append(
|
files.append(
|
||||||
|
Loading…
Reference in New Issue
Block a user