Source: python-aiosmtpd
Version: 1.4.6-1
Severity: normal
User: debian-pyt...@lists.debian.org
Usertags: python3.13
Forwarded: https://github.com/aio-libs/aiosmtpd/pull/473

This package failed build from source when test-built against a version of
python3-defaults that includes 3.13 as a supported version.

To reproduce this issue, build against python3-defaults (python3-all-dev etc.)
from Debian experimental.

What's new in Python 3.13:
https://docs.python.org/3.13/whatsnew/3.13.html

Log snippet:

aiosmtpd/qa/test_1testsuite.py .....                                     [  1%]
aiosmtpd/tests/test_handlers.py ........................................ [  8%]
......                                                                   [  9%]
aiosmtpd/tests/test_lmtp.py ....                                         [ 10%]
aiosmtpd/tests/test_main.py ......................................       [ 17%]
aiosmtpd/tests/test_misc.py ..                                           [ 17%]
aiosmtpd/tests/test_proxyprotocol.py ................................... [ 23%]
........................................................................ [ 36%]
.............                                                            [ 38%]
aiosmtpd/tests/test_server.py ...........................F..s.           [ 44%]
aiosmtpd/tests/test_smtp.py ............................................ [ 52%]
........................................................................ [ 65%]
........................................................................ [ 78%]
........................................................................ [ 90%]
....................                                                     [ 94%]
aiosmtpd/tests/test_smtps.py .                                           [ 94%]
aiosmtpd/tests/test_smtpsmuggling.py .                                   [ 94%]
aiosmtpd/tests/test_starttls.py .............................            [100%]

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

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

    @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:454: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

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

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

aiosmtpd/tests/test_server.py:104: AssertionError
------------------------------ Captured log call -------------------------------
INFO     mail.log:smtp.py:407 Available AUTH mechanisms: LOGIN(builtin) 
PLAIN(builtin)
INFO     mail.log:smtp.py:523 Peer: ''
INFO     mail.log:smtp.py:615 '' handling connection
DEBUG    mail.log:smtp.py:599 '' << b'220 sbuild Python SMTP 1.4.6'
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:599 '' << b'250-sbuild'
DEBUG    mail.log:smtp.py:599 '' << b'250-SIZE 33554432'
DEBUG    mail.log:smtp.py:599 '' << b'250-8BITMIME'
DEBUG    mail.log:smtp.py:599 '' << b'250-SMTPUTF8'
DEBUG    mail.log:smtp.py:599 '' << 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:599 '' << b'221 Bye'
INFO     mail.log:smtp.py:530 '' connection lost
INFO     mail.log:smtp.py:761 '' Connection lost during _handle_client()
=============================== warnings summary ===============================
aiosmtpd/tests/conftest.py:15
  
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_aiosmtpd/build/aiosmtpd/tests/conftest.py:15:
 DeprecationWarning: pkg_resources is deprecated as an API. See 
https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import resource_filename

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
=========================== short test summary info ============================
FAILED aiosmtpd/tests/test_server.py::TestUnthreaded::test_unixsocket - Asser...
= 1 failed, 559 passed, 2 skipped, 4 deselected, 1 warning in 83.59s (0:01:23) =
E: pybuild pybuild:389: test: plugin pyproject failed with: exit code=1: cd 
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.13_aiosmtpd/build; python3.13 -m pytest -k 
"not (unknown_args_ or factory_none or noexc_smtpd_missing)"
I: pybuild base:311: cd /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_aiosmtpd/build; 
python3.12 -m pytest -k "not (unknown_args_ or factory_none or 
noexc_smtpd_missing)"
============================= test session starts ==============================
platform linux -- Python 3.12.6, pytest-8.3.3, pluggy-1.5.0
rootdir: /<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_aiosmtpd/build
configfile: pyproject.toml
plugins: mock-3.14.0, typeguard-4.3.0
collected 566 items / 4 deselected / 562 selected

aiosmtpd/qa/test_0packaging.py .s..                                      [  0%]
aiosmtpd/qa/test_1testsuite.py .....                                     [  1%]
aiosmtpd/tests/test_handlers.py ........................................ [  8%]
......                                                                   [  9%]
aiosmtpd/tests/test_lmtp.py ....                                         [ 10%]
aiosmtpd/tests/test_main.py ......................................       [ 17%]
aiosmtpd/tests/test_misc.py ..                                           [ 17%]
aiosmtpd/tests/test_proxyprotocol.py ................................... [ 23%]
........................................................................ [ 36%]
.............                                                            [ 38%]
aiosmtpd/tests/test_server.py ..............................s.           [ 44%]
aiosmtpd/tests/test_smtp.py ............................................ [ 52%]
........................................................................ [ 65%]
........................................................................ [ 78%]
........................................................................ [ 90%]
....................                                                     [ 94%]
aiosmtpd/tests/test_smtps.py .                                           [ 94%]
aiosmtpd/tests/test_smtpsmuggling.py .                                   [ 94%]
aiosmtpd/tests/test_starttls.py .............................            [100%]

=============================== warnings summary ===============================
aiosmtpd/tests/conftest.py:15
  
/<<PKGBUILDDIR>>/.pybuild/cpython3_3.12_aiosmtpd/build/aiosmtpd/tests/conftest.py:15:
 DeprecationWarning: pkg_resources is deprecated as an API. See 
https://setuptools.pypa.io/en/latest/pkg_resources.html
    from pkg_resources import resource_filename

-- Docs: https://docs.pytest.org/en/stable/how-to/capture-warnings.html
====== 560 passed, 2 skipped, 4 deselected, 1 warning in 83.58s (0:01:23) ======
        rm -fr -- /tmp/dh-xdg-rundir-rR4vIT4F
dh_auto_test: error: pybuild --test --test-pytest -i python{version} -p "3.13 
3.12" returned exit code 13
make: *** [debian/rules:11: binary] Error 25
dpkg-buildpackage: error: debian/rules binary subprocess returned exit status 2
--------------------------------------------------------------------------------
Build finished at 2024-09-18T21:49:16Z


If required, the full build log is available here (for the next 30 days):
https://debusine.debian.net/artifact/780642/

This bug has been filed at "normal" severity, as we haven't started the
transition to add 3.13 as a supported version, yet. This will be raised to RC
as soon as that happens, hopefully well before trixie.

Thanks,

Stefano

Reply via email to