Re: [Mailman-Developers] [Mailman-checkins] [Branch ~mailman-coders/mailman/3.0]

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1 On Nov 6, 2007, at 9:07 PM, noreply@launchpad.net wrote:
------------------------------------------------------------ revno: 6573 committer: Mark Sapiro <msapiro@value.net> branch nick: 3.0 timestamp: Tue 2007-11-06 18:03:28 -0800 message: - Scrubber.py Fixed an issue where an implicit text/plain part without any headers gets lost.
Moved the cleansing of the filename extension to a place where it is guaranteed to be a string as opposed to an empty list. modified: Mailman/Handlers/Scrubber.py
=== modified file 'Mailman/Handlers/Scrubber.py' --- a/Mailman/Handlers/Scrubber.py 2007-10-31 21:38:51 +0000 +++ b/Mailman/Handlers/Scrubber.py 2007-11-07 02:03:28 +0000 @@ -46,7 +46,7 @@ # Path characters for common platforms pre = re.compile(r'[/\\:]') # All other characters to strip out of Content-Disposition: filenames -# (essentially anything that isn't an alphanum, dot, slash, or underscore. +# (essentially anything that isn't an alphanum, dot, dash, or underscore). sre = re.compile(r'[^-\w.]') # Regexp to strip out leading dots dre = re.compile(r'^\.*') @@ -265,7 +265,7 @@ # If the message isn't a multipart, then we'll strip it out as an # attachment that would have to be separately downloaded. Pipermail # will transform the url into a hyperlink. - elif part and not part.is_multipart(): + elif part._payload and not part.is_multipart():
I'm not sure it's a good idea to use this non-public attribute. 'part.get_payload()' would probably be a better test. - -Barry -----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin) iD8DBQFHQH3Q2YZpQepbvXERAh5kAJ9vkjyCoAV10aYaNEDE34i9KNKQxgCgjF3p c7yN8r7OSuvkTjVUXa75zKA= =V12k -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
Barry Warsaw wrote:
On Nov 6, 2007, at 9:07 PM, noreply@launchpad.net wrote:
revno: 6573 committer: Mark Sapiro <msapiro@value.net> <snip> # If the message isn't a multipart, then we'll strip it
out as an # attachment that would have to be separately downloaded.
Pipermail # will transform the url into a hyperlink.
elif part and not part.is_multipart():
elif part._payload and not part.is_multipart():
I'm not sure it's a good idea to use this non-public attribute.
'part.get_payload()' would probably be a better test.
I think Barry is right, but I did it as I did because of a concern expressed by Tokio at <http://mail.python.org/pipermail/mailman-users/2006-December/054961.html>.
I'll gladly change it to get_payload()
Mark Sapiro <msapiro@value.net> The highway is for gamblers, San Francisco Bay Area, California better use your sense - B. Dylan
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (MingW32)
iD8DBQFHQIStVVuXXpU7hpMRAlVhAJ9M5OX2iT3Blt5QzQ2UPBuRY+1XUACg4rHg MZywGERykk1M7brgkGDtUcA= =bXYJ -----END PGP SIGNATURE-----

-----BEGIN PGP SIGNED MESSAGE----- Hash: SHA1
On Nov 18, 2007, at 1:30 PM, Mark Sapiro wrote:
I think Barry is right, but I did it as I did because of a concern expressed by Tokio at <http://mail.python.org/pipermail/mailman-users/2006-December/ 054961.html>.
I'll gladly change it to get_payload()
Tokio has a point (and it's something I want to improve in the next
version of the email package), but with decode=False, get_payload()
isn't too bad.
- -Barry
-----BEGIN PGP SIGNATURE----- Version: GnuPG v1.4.7 (Darwin)
iD8DBQFHQIaB2YZpQepbvXERAp7rAJ47da4MPipdBcdY3N0oAB5L6AtTSgCgmQZh RwjUFOjNg/LXnSvURzoIiEo= =cQSq -----END PGP SIGNATURE-----
participants (2)
-
Barry Warsaw
-
Mark Sapiro