[Mailman-Users] Attachments are unexpectedly re-created.

Mark Sapiro mark at msapiro.net
Thu Mar 4 05:15:04 CET 2010


Masaharu Kawada wrote:

>Kikuchi-san, Mark-san,
>
>I will ask the customer to consider patching it.
>
>Thanks a million!!!
>
>Best Regards,
>
>Tokio Kikuchi wrote:
>> (10/03/04 11:47), Masaharu Kawada wrote:
>>   
>>> Hi Mark-san, Kikuchi-san,
>>>
>>> Thank you very much for your help.
>>>
>>> Just to make sure, about the patch, is it just need to be modified in the
>>> way you mentioned? Which means that it should be look like below.
>>>     
>>
>> Yes, its OK.
>>
>>   
>>> # vi  /usr/lib/python2.4/email/Charset.py
>>>
>>> ---<Before modifying>---
>>>    243     def convert(self, s):
>>>    244         """Convert a string from the input_codec to the output_codec."""
>>>    245         if self.input_codec <> self.output_codec:
>>>    246             return unicode(s, self.input_codec).encode(self.output_codec)
>>>    247         else:
>>>    248             return s
>>>
>>> ---<After modifying>---
>>>    243     def convert(self, s):
>>>    244         """Convert a string from the input_codec to the
>>> output_codec."""
>>>    245         if self.input_codec != self.output_codec:
>>>    246             return unicode(s, self.input_codec,
>>> 'replace').encode(self.output_codec, 'replace')
>>>    247             return unicode(s,
>>> self.input_codec).encode(self.output_codec)
>>>    248         else:
>>>    249             return s
>>>


Actually, that's not quite right. It should be

>>> ---<After modifying>---
>>>    243     def convert(self, s):
>>>    244         """Convert a string from the input_codec to the output_codec."""
>>>    245         if self.input_codec != self.output_codec:
>>>    246             return unicode(s, self.input_codec, 'replace'
>>>    247                      ).encode(self.output_codec, 'replace')
>>>    248         else:
>>>    249             return s


The exact line numbers will depend on the Python version.

Although, what you have would work because the first return at line 246
is correct although it is all on one line and the second return at
line 246 which is the problem will never be reached.

-- 
Mark Sapiro <mark at msapiro.net>        The highway is for gamblers,
San Francisco Bay Area, California    better use your sense - B. Dylan



More information about the Mailman-Users mailing list