--- Python-2.7.1/Lib/httplib.py.ark 2011-04-21 15:32:23.765795879 +0200 +++ Python-2.7.1/Lib/httplib.py 2011-04-21 15:38:15.855787301 +0200 @@ -792,8 +792,13 @@ class HTTPConnection: # it will avoid performance problems caused by the interaction # between delayed ack and the Nagle algorithim. if isinstance(message_body, str): - msg += message_body - message_body = None + try: + msg += message_body + message_body = None + except UnicodeDecodeError: + # This could be binary data - we can treat it like + # something that isn't a str instance + pass self.send(msg) if message_body is not None: #message_body was not a string (i.e. it is a file) and