[Checkins] [zopefoundation/zope.sendmail] b841d8: `Maildir.newMessage` returns a MaildirMessageWrite...

Michael Howitz noreply at github.com
Fri Mar 29 10:40:50 CET 2019


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

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

  Log Message:
  -----------
  `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 bytes for Python 3.

The change is necessary to get the tests in zopefoundation/Products.MailHost#15 green.

Closes #23. (Which had a different implementation.)




More information about the checkins mailing list