(Cherry pick v7.2.1)

This commit is contained in:
medmunds
2020-08-05 11:44:14 -07:00
parent 85cec5e9dc
commit 48a9aaebf4
2 changed files with 22 additions and 0 deletions

View File

@@ -49,6 +49,18 @@ Breaking changes
`mixin superclass ordering <https://nedbatchelder.com/blog/201210/multiple_inheritance_is_hard.html#comment_13805>`__.)
v7.2.1
------
*2020-08-05*
Fixes
~~~~~
* **Inbound:** Fix a Python 2.7-only UnicodeEncodeError when attachments have non-ASCII
filenames. (Thanks to `@kika115`_ for reporting it.)
v7.2 LTS
--------
@@ -1123,6 +1135,7 @@ Features
.. _@janneThoft: https://github.com/janneThoft
.. _@jc-ee: https://github.com/jc-ee
.. _@joshkersey: https://github.com/joshkersey
.. _@kika115: https://github.com/kika115
.. _@Lekensteyn: https://github.com/Lekensteyn
.. _@lewistaylor: https://github.com/lewistaylor
.. _@mbk-ok: https://github.com/mbk-ok

View File

@@ -134,6 +134,15 @@ class AnymailInboundMessageConstructionTests(SimpleTestCase):
att = AnymailInboundMessage.construct_attachment(content_type="image/png", content=content, base64=True)
self.assertEqual(att.get_content_bytes(), SAMPLE_IMAGE_CONTENT)
def test_construct_attachment_unicode_filename(self):
# Issue #197
att = AnymailInboundMessage.construct_attachment(
content_type="text/plain", content="Unicode ✓", charset='utf-8', base64=False,
filename="Simulácia.txt", content_id="inline-id",)
self.assertEqual(att.get_filename(), "Simulácia.txt")
self.assertTrue(att.is_inline_attachment())
self.assertEqual(att.get_content_text(), "Unicode ✓")
def test_parse_raw_mime(self):
# (we're not trying to exhaustively test email.parser MIME handling here;
# just that AnymailInboundMessage.parse_raw_mime calls it correctly)