~/papyon [master] $ git log -p -1
commit bc69834f24838ed10de20da358dda9ecdcaf2873
Author: Olivier Le Thanh Duong <oliv...@lethanh.be>
Date:   Wed Sep 30 21:40:38 2009 +0200

    Fix crash when printing unicode char in message headers (fd.o #24223)
    
    Call repr() on headers' values in our re-implementation of Message.__repr__
    to avoid an UnicodeDecodeException when logging

diff --git a/papyon/msnp/message.py b/papyon/msnp/message.py
index 92e95e1..506737c 100644
--- a/papyon/msnp/message.py
+++ b/papyon/msnp/message.py
@@ -69,7 +69,7 @@ class Message(HTTPMessage):
         """Represents the payload of the message"""
         message = ''
         for header_name, header_value in self.headers.iteritems():
-            message += '\t%s: %s\\r\\n\n' % (header_name, header_value)
+            message += '\t%s: %s\\r\\n\n' % (header_name, repr(header_value))
         message += '\t\\r\\n\n'
         if self.headers['Content-Type'] != "application/x-msnmsgrp2p":
             message += '\t' + debug.escape_string(self.body).\

-- 
telepathy-butterfly crashed with UnicodeDecodeError in _print_MSG()
https://bugs.launchpad.net/bugs/432558
You received this bug notification because you are a member of Ubuntu
Bugs, which is subscribed to Ubuntu.

-- 
ubuntu-bugs mailing list
ubuntu-bugs@lists.ubuntu.com
https://lists.ubuntu.com/mailman/listinfo/ubuntu-bugs

Reply via email to