diff options
| author | Aurélien Bompard <aurelien@bompard.org> | 2012-10-03 11:17:26 +0200 |
|---|---|---|
| committer | Aurélien Bompard <aurelien@bompard.org> | 2012-10-03 11:17:26 +0200 |
| commit | c16402f89e3d86de315dd309a1d8efe702c2a329 (patch) | |
| tree | 64f8e9b7dcc7e7277d85f180a25a7771cbc16ba7 | |
| parent | 5784ad8bfd783487aa8a6abd1e4bb689874f8c67 (diff) | |
| download | kittystore-c16402f89e3d86de315dd309a1d8efe702c2a329.tar.gz kittystore-c16402f89e3d86de315dd309a1d8efe702c2a329.tar.xz kittystore-c16402f89e3d86de315dd309a1d8efe702c2a329.zip | |
Fix text attachment handling
| -rw-r--r-- | kittystore/scrub.py | 1 | ||||
| -rw-r--r-- | kittystore/test/test_scrub.py | 4 |
2 files changed, 4 insertions, 1 deletions
diff --git a/kittystore/scrub.py b/kittystore/scrub.py index 8c98803..74aeed9 100644 --- a/kittystore/scrub.py +++ b/kittystore/scrub.py @@ -119,6 +119,7 @@ class Scrubber(object): if disposition and disposition.strip().startswith("attachment"): # part is attached self.save_attachment(part, part_num) + part.set_payload('') elif ctype == 'text/html' and isinstance(sanitize, IntType): # if sanitize == 0: # if outer: diff --git a/kittystore/test/test_scrub.py b/kittystore/test/test_scrub.py index b42a9d5..205167c 100644 --- a/kittystore/test/test_scrub.py +++ b/kittystore/test/test_scrub.py @@ -120,5 +120,7 @@ class TestScrubber(unittest.TestCase): 4, u"todo-déjeuner.txt", "text/plain", "utf-8")) self.assertEqual(len(args_2[0][6]), 112) # Scrubbed content - self.assertEqual(contents, u"This is a test message\r\n") + self.assertEqual(contents, u'This is a test, HTML message with ' + u'accented letters : \xe9 \xe8 \xe7 \xe0.\r\nAnd an ' + u'attachment with an accented filename\r\n') |
