Skip to content

Commit

Permalink
Quick fix Queued Mail Delivery Sets Wrong Charset (repoze#41)
Browse files Browse the repository at this point in the history
  • Loading branch information
mg committed Apr 17, 2018
1 parent df004f8 commit f6bb346
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 4 deletions.
6 changes: 3 additions & 3 deletions CHANGES.rst
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
Change history
~~~~~~~~~~~~~~

4.5 (unreleased)
----------------
4.4.1+lu1 (unreleased)
----------------------

- TBD
- Quick fix Queued Mail Delivery Sets Wrong Charset (#41)

4.4.1 (2017-04-21)
------------------
Expand Down
8 changes: 8 additions & 0 deletions repoze/sendmail/encoding.py
Original file line number Diff line number Diff line change
Expand Up @@ -72,6 +72,14 @@ def cleanup_message(message,
payload = message.get_payload()
if payload and isinstance(payload, text_type):
charset = message.get_charset()
# see https://github.com/repoze/repoze.sendmail/issues/41
# We ran into this problem while upgrading our apps to
# py36. Maybe the api for email.message changed.
# We are not sure if older versions of email.message.Message
# have 'get_param'.
if not charset:
if hasattr(message, 'get_param'):
charset = message.get_param('charset')
if not charset:
charset, encoded = best_charset(payload)
message.set_payload(payload, charset=charset)
Expand Down
2 changes: 1 addition & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ def _read_file(filename):
CHANGES = _read_file('CHANGES.rst')

setup(name='repoze.sendmail',
version = '4.5.dev0',
version = '4.4.1+lu1.dev0',
url='http://www.repoze.org',
license='ZPL 2.1',
description='Repoze Sendmail',
Expand Down

0 comments on commit f6bb346

Please sign in to comment.