From a10c662207d6203e1e4bba2ad4e91dd8485c4cfa Mon Sep 17 00:00:00 2001 From: Garret Wassermann Date: Wed, 7 Feb 2018 02:14:28 -0500 Subject: [PATCH] Patch for #582, POP3 processing error on py3 --- helpdesk/management/commands/get_email.py | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/helpdesk/management/commands/get_email.py b/helpdesk/management/commands/get_email.py index 520ab3d5..a044d6bb 100755 --- a/helpdesk/management/commands/get_email.py +++ b/helpdesk/management/commands/get_email.py @@ -176,7 +176,10 @@ def process_queue(q, logger): msgNum = msg.split(" ")[0] logger.info("Processing message %s" % msgNum) - full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace') + if six.PY2: + full_message = encoding.force_text("\n".join(server.retr(msgNum)[1]), errors='replace') + else: + full_message = encoding.force_text(b"\n".join(server.retr(msgNum)[1]), errors='replace') ticket = ticket_from_message(message=full_message, queue=q, logger=logger) if ticket: