Bug 2263017 - python-aiosmtpd fails to build with Python 3.13: aiosmtpd/tests/test_server.py::TestUnthreaded::test_unixsocket AssertionError: assert Path(controller.unix_socket).exists()
Summary: python-aiosmtpd fails to build with Python 3.13: aiosmtpd/tests/test_server.p...
Keywords:
Status: NEW
Alias: None
Product: Fedora
Classification: Fedora
Component: python-aiosmtpd
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Aurelien Bompard
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
Depends On:
Blocks: PYTHON3.13
TreeView+ depends on / blocked
 
Reported: 2024-02-06 16:02 UTC by Karolina Surma
Modified: 2024-02-06 16:41 UTC (History)
6 users (show)

Fixed In Version:
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed:
Type: Bug
Embargoed:


Attachments (Terms of Use)


Links
System ID Private Priority Status Summary Last Updated
Github aio-libs aiosmtpd issues 403 0 None open assert_smtp_socket fails with Python 3.13.0a3 2024-02-06 16:41:28 UTC

Description Karolina Surma 2024-02-06 16:02:59 UTC
python-aiosmtpd fails to build with Python 3.13.0a3.

=================================== FAILURES ===================================
________________________ TestUnthreaded.test_unixsocket ________________________

self = <aiosmtpd.tests.test_server.TestUnthreaded object at 0x7f9b025449b0>
safe_socket_dir = PosixPath('/tmp/tmpmdp0502n')
autostop_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
runner = <function TestUnthreaded.runner.<locals>.starter at 0x7f9b026cdb20>

    @pytest.mark.skipif(in_cygwin(), reason="Cygwin AF_UNIX is problematic")
    @pytest.mark.skipif(in_win32(), reason="Win32 does not yet fully implement AF_UNIX")
    def test_unixsocket(self, safe_socket_dir, autostop_loop, runner):
        sockfile = safe_socket_dir / "smtp"
        cont = UnixSocketUnthreadedController(
            Sink(), unix_socket=sockfile, loop=autostop_loop
        )
        cont.begin()
        # Make sure event loop is not running (will be started in thread)
        assert autostop_loop.is_running() is False
        runner(autostop_loop)
        # Make sure event loop is up and running (started within thread)
        assert autostop_loop.is_running() is True
        # Check we can connect
        assert_smtp_socket(cont)
        # Wait until thread ends, which it will be when the loop autostops
        runner.join(timeout=AUTOSTOP_DELAY)
        assert runner.is_alive() is False
        catchup_delay()
        assert autostop_loop.is_running() is False
        # At this point, the loop _has_ stopped, but the task is still listening
        assert assert_smtp_socket(cont) is False
        # Stop the task
        cont.end()
        catchup_delay()
        # Now the listener has gone away
        # noinspection PyTypeChecker
        with pytest.raises((socket.timeout, ConnectionError)):
>           assert_smtp_socket(cont)

aiosmtpd/tests/test_server.py:452: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

controller = <aiosmtpd.controller.UnixSocketUnthreadedController object at 0x7f9b02776db0>

    def assert_smtp_socket(controller: UnixSocketMixin) -> bool:
>       assert Path(controller.unix_socket).exists()
E       AssertionError: assert False
E        +  where False = <bound method PathBase.exists of PosixPath('/tmp/tmpmdp0502n/smtp')>()
E        +    where <bound method PathBase.exists of PosixPath('/tmp/tmpmdp0502n/smtp')> = PosixPath('/tmp/tmpmdp0502n/smtp').exists
E        +      where PosixPath('/tmp/tmpmdp0502n/smtp') = Path('/tmp/tmpmdp0502n/smtp')
E        +        where '/tmp/tmpmdp0502n/smtp' = <aiosmtpd.controller.UnixSocketUnthreadedController object at 0x7f9b02776db0>.unix_socket

aiosmtpd/tests/test_server.py:103: AssertionError
------------------------------ Captured log call -------------------------------
INFO     mail.log:smtp.py:407 Available AUTH mechanisms: LOGIN(builtin) PLAIN(builtin)
INFO     mail.log:smtp.py:519 Peer: ''
INFO     mail.log:smtp.py:601 '' handling connection
DEBUG    mail.log:smtp.py:587 '' << b'220 localhost.localdomain Python SMTP 1.4.4.post2'
DEBUG    mail.log:smtp.py:286 _handle_client readline: b'EHLO socket.test\r\n'
INFO     mail.log:smtp.py:286 '' >> b'EHLO socket.test'
DEBUG    mail.log:smtp.py:587 '' << b'250-localhost.localdomain'
DEBUG    mail.log:smtp.py:587 '' << b'250-SIZE 33554432'
DEBUG    mail.log:smtp.py:587 '' << b'250-8BITMIME'
DEBUG    mail.log:smtp.py:587 '' << b'250-SMTPUTF8'
DEBUG    mail.log:smtp.py:587 '' << b'250 HELP'
DEBUG    mail.log:smtp.py:286 _handle_client readline: b'QUIT\r\n'
INFO     mail.log:smtp.py:286 '' >> b'QUIT'
DEBUG    mail.log:smtp.py:587 '' << b'221 Bye'
INFO     mail.log:smtp.py:525 '' connection lost
INFO     mail.log:smtp.py:746 '' Connection lost during _handle_client()
=========================== short test summary info ============================
FAILED aiosmtpd/tests/test_server.py::TestUnthreaded::test_unixsocket - Asser...
====== 1 failed, 559 passed, 1 skipped, 4 deselected in 80.33s (0:01:20) =======


https://docs.python.org/3.13/whatsnew/3.13.html

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.13/fedora-rawhide-x86_64/06989324-python-aiosmtpd/

For all our attempts to build python-aiosmtpd with Python 3.13, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/package/python-aiosmtpd/

Testing and mass rebuild of packages is happening in copr.
You can follow these instructions to test locally in mock if your package builds with Python 3.13:
https://copr.fedorainfracloud.org/coprs/g/python/python3.13/

Let us know here if you have any questions.

Python 3.13 is planned to be included in Fedora 41.
To make that update smoother, we're building Fedora packages with all pre-releases of Python 3.13.
A build failure prevents us from testing all dependent packages (transitive [Build]Requires),
so if this package is required a lot, it's important for us to get it fixed soon.

We'd appreciate help from the people who know this package best,
but if you don't want to work on this now, let us know so we can try to work around it on our side.

Comment 1 Miro Hrončok 2024-02-06 16:41:28 UTC
I've reproduced this upstream and reported https://github.com/aio-libs/aiosmtpd/issues/403


Note You need to log in before you can comment on or make changes to this bug.