Skip to content

AttributeError: module 'email' has no attribute 'message' #345

@d-kazantsev

Description

@d-kazantsev

When I run unittest for my code and facing an Assertion error I got below AttributeError instead of clear information about AssertionError:

File "/XXXXXXX/py3/lib/python3.10/site-packages/testtools/testresult/real.py", line 766, in _make_content_type
msg = email.message.EmailMessage()
AttributeError: module 'email' has no attribute 'message'

I managed to solve this problem by updating real.py. I "import email.message" instead of just "import email". Could you please check/correct source code?

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions