Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Plone 5.2 on Python 3 tests fail with MailHost 4.10 #33

Closed
mauritsvanrees opened this issue Sep 16, 2020 · 5 comments
Closed

Plone 5.2 on Python 3 tests fail with MailHost 4.10 #33

mauritsvanrees opened this issue Sep 16, 2020 · 5 comments

Comments

@mauritsvanrees
Copy link
Member

Plone 5.2.2 uses Products.MailHost 4.9. When I change the core development buildout to use 4.10, as in this PR, there are 26 failures.

  • The tests on Python 2.7 are fine
  • The tests on Python 3.6 fail
  • The tests on Python 3.7 fail

Errors are like this:

initial_value must be str or None, not bytes

  File "/srv/python3.7/lib/python3.7/unittest/case.py", line 59, in testPartExecutor
    yield
  File "/srv/python3.7/lib/python3.7/unittest/case.py", line 628, in run
    testMethod()
  File "/home/jenkins/workspace/pull-request-5.2-3.7/src/Products.CMFPlone/Products/CMFPlone/tests/testRegistrationTool.py", line 212, in testMailPassword
    msg = message_from_string(mails.messages[0])
  File "/srv/python3.7/lib/python3.7/email/__init__.py", line 38, in message_from_string
    return Parser(*args, **kws).parsestr(s)
  File "/srv/python3.7/lib/python3.7/email/parser.py", line 67, in parsestr
    return self.parse(StringIO(text), headersonly=headersonly)

I am not sure yet if this is only in tests, or for real. We are certainly mocking the MailHost object in tests, so maybe it needs to be changed.

But does this seem like an error in how Products.MailHost handles this? Certainly this is caused by the changes in #30.

@jugmac00
Copy link
Member

My app's test suite also failed after updating to MailHost 4.10. I updated the tests, deployed it to staging, and experienced no errors while sending/receiving emails. This may be a (weak) indication the changes were probably ok, but the tests need an update.

@dataflake
Copy link
Member

I concur with @jugmac00 . I would take a look at your tests first.

@dataflake dataflake removed the bug label Sep 16, 2020
@d-maurer
Copy link
Contributor

d-maurer commented Sep 16, 2020 via email

@d-maurer
Copy link
Contributor

d-maurer commented Sep 17, 2020 via email

@mauritsvanrees
Copy link
Member Author

I have made the fixes on the Plone side. If I recall correctly, there were indeed only changes needed in tests, not in production code.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

4 participants