[Author Prev][Author Next][Thread Prev][Thread Next][Author Index][Thread Index]

[tor-commits] [bridgedb/develop] Fix UnicodeDecodeError in b.e.server.SMTPMessage.getIncomingMessage().



commit e02faa07a9a0d4135559e606cfd838858eae018a
Author: Isis Lovecruft <isis@xxxxxxxxxxxxxx>
Date:   Wed Jul 30 21:07:46 2014 +0000

    Fix UnicodeDecodeError in b.e.server.SMTPMessage.getIncomingMessage().
    
     * FIXES a bug where an unhandled UnicodeDecodeError is raised upon
       receiving an incoming message with certain unicode characters inside.
---
 lib/bridgedb/email/server.py |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lib/bridgedb/email/server.py b/lib/bridgedb/email/server.py
index 53105f5..66362e2 100644
--- a/lib/bridgedb/email/server.py
+++ b/lib/bridgedb/email/server.py
@@ -211,7 +211,7 @@ class SMTPMessage(object):
         """
         rawMessage = io.StringIO()
         for line in self.lines:
-            rawMessage.writelines(unicode(line) + unicode('\n'))
+            rawMessage.writelines(unicode(line.decode('utf8')) + u'\n')
         rawMessage.seek(0)
         return smtp.rfc822.Message(rawMessage)
 



_______________________________________________
tor-commits mailing list
tor-commits@xxxxxxxxxxxxxxxxxxxx
https://lists.torproject.org/cgi-bin/mailman/listinfo/tor-commits