diff roundup/mailgw.py @ 4980:13f8f88ad984

Replace rfc822 imports with email package (issue2550870) The rfc822 package has been deprecated since Python v2.3 in favour of the email package.
author John Kristensen <john@jerrykan.com>
date Fri, 27 Feb 2015 00:48:25 +1100
parents 6e9b9743de89
children 7f8f27ce1a06
line wrap: on
line diff
--- a/roundup/mailgw.py	Mon Mar 16 16:16:02 2015 +0100
+++ b/roundup/mailgw.py	Fri Feb 27 00:48:25 2015 +1100
@@ -80,7 +80,8 @@
 
 import string, re, os, mimetools, cStringIO, smtplib, socket, binascii, quopri
 import time, random, sys, logging
-import traceback, rfc822
+import traceback
+import email.utils
 
 from anypy.email_ import decode_header
 
@@ -147,7 +148,7 @@
         if '=' in f:
             i = f.index('=')
             if f[:i].strip().lower() == param:
-                return rfc822.unquote(f[i+1:].strip())
+                return email.utils.unquote(f[i+1:].strip())
     return None
 
 def gpgh_key_getall(key, attr):

Roundup Issue Tracker: http://roundup-tracker.org/