[Checkins] [zopefoundation/zope.sendmail] 0fb012: Fix text/bytes issue in MailDir for Python 3.

Michael Howitz noreply at github.com
Wed Mar 27 11:36:40 CET 2019


  Branch: refs/heads/fix-maildir
  Home:   https://github.com/zopefoundation/zope.sendmail
  Commit: 0fb01200043f698fb7d51dba6f912efac8d38a74
      https://github.com/zopefoundation/zope.sendmail/commit/0fb01200043f698fb7d51dba6f912efac8d38a74
  Author: Michael Howitz <mh at gocept.com>
  Date:   2019-03-27 (Wed, 27 Mar 2019)

  Changed paths:
    M CHANGES.rst
    M src/zope/sendmail/maildir.py
    M src/zope/sendmail/tests/test_maildir.py

  Log Message:
  -----------
  Fix text/bytes issue in MailDir for Python 3.

`Maildir.newMessage` returns a MaildirMessageWriter with a file handle opened
in text mode, see
https://github.com/zopefoundation/zope.sendmail/blob/2ee8b0a454ff484335e6b65b9d46a695309a2b2f/src/zope/sendmail/maildir.py#L110
(mode is 'w' not 'wb')

But `MaildirMessageWriter.write` writes bytes to this file handle, see
https://github.com/zopefoundation/zope.sendmail/blob/2ee8b0a454ff484335e6b65b9d46a695309a2b2f/src/zope/sendmail/maildir.py#L131-L132

This commit changes the implementation to use text for Python 3.




More information about the checkins mailing list