diff --git a/rhodecode/lib/rcmail/response.py b/rhodecode/lib/rcmail/response.py --- a/rhodecode/lib/rcmail/response.py +++ b/rhodecode/lib/rcmail/response.py @@ -364,6 +364,7 @@ def to_message(mail, separator="; "): return out + class MIMEPart(MIMEBase): """ A reimplementation of nearly everything in email.mime to be more useful @@ -387,7 +388,8 @@ class MIMEPart(MIMEBase): self.set_payload(encoded, charset=charset) def extract_payload(self, mail): - if mail.body == None: return # only None, '' is still ok + if mail.body == None: + return # only None, '' is still ok ctype, ctype_params = mail.content_encoding['Content-Type'] cdisp, cdisp_params = mail.content_encoding['Content-Disposition'] @@ -415,7 +417,8 @@ class MIMEPart(MIMEBase): def header_to_mime_encoding(value, not_email=False, separator=", "): - if not value: return "" + if not value: + return "" encoder = Charset(DEFAULT_ENCODING) if type(value) == list: @@ -424,6 +427,7 @@ def header_to_mime_encoding(value, not_e else: return properly_encode_header(value, encoder, not_email) + def properly_encode_header(value, encoder, not_email): """ The only thing special (weird) about this function is that it tries