ikvk / imap_tools

Work with email by IMAP
Apache License 2.0
719 stars 83 forks source link

Tests fail with Python 3.12.6+ #242

Closed K900 closed 1 month ago

K900 commented 1 month ago
=================================== FAILURES ===================================
_____________________ UtilsTest.test_parse_email_addresses _____________________

self = <tests.test_utils.UtilsTest testMethod=test_parse_email_addresses>

    def test_parse_email_addresses(self):
>       self.assertEqual(
            parse_email_addresses('=?UTF-8?B?0J7Qu9C1=?= <name@company.ru>,\r\n "\'\\"z, z\\"\'" <ya@ya.ru>\f'),
            (EmailAddress('Оле', 'name@company.ru'),
             EmailAddress('\'"z, z"\'', 'ya@ya.ru'))
        )
E       AssertionError: Tuples differ: () != (EmailAddress(name='Оле', email='name@comp[55 chars]ru'))
E
E       Second tuple contains 2 additional elements.
E       First extra element 0:
E       EmailAddress(name='Оле', email='name@company.ru')
E
E       - ()
E       + (EmailAddress(name='Оле', email='name@company.ru'),
E       +  EmailAddress(name='\'"z, z"\'', email='ya@ya.ru'))

tests/test_utils.py:115: AssertionError
=========================== short test summary info ============================
FAILED tests/test_utils.py::UtilsTest::test_parse_email_addresses - AssertionError: Tuples differ: () != (EmailAddress(name='Оле', email='name@...
================== 1 failed, 19 passed, 6 deselected in 0.09s ==================

It looks like the newly added validation logic from https://github.com/python/cpython/commit/15068242bd4405475f70a81805a8895ca309a310 breaks on the \f character, which I'm not sure is allowed by the spec in the first place.

ikvk commented 1 month ago

interesting, ill check it

ikvk commented 1 month ago

Thanks! :D

https://github.com/ikvk/imap_tools/releases/tag/v1.7.3