Note: This is a public test instance of Red Hat Bugzilla. The data contained within is a snapshot of the live data so any changes you make will not be reflected in the production Bugzilla. Email is disabled so feel free to test any aspect of the site that you want. File any problems you find or give feedback at bugzilla.redhat.com.
Bug 1906349 - python-aiofiles fails to build with Python 3.10: TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop'
Summary: python-aiofiles fails to build with Python 3.10: TypeError: BaseEventLoop.cre...
Keywords:
Status: CLOSED ERRATA
Alias: None
Product: Fedora
Classification: Fedora
Component: python-aiofiles
Version: rawhide
Hardware: Unspecified
OS: Unspecified
unspecified
unspecified
Target Milestone: ---
Assignee: Igor Raits
QA Contact: Fedora Extras Quality Assurance
URL:
Whiteboard:
: 1968885 (view as bug list)
Depends On:
Blocks: PYTHON3.10 F35FTBFS, RAWHIDEFTBFS F35FailsToInstall, RAWHIDEFailsToInstall 1968972 1969145
TreeView+ depends on / blocked
 
Reported: 2020-12-10 10:33 UTC by Tomáš Hrnčiar
Modified: 2021-06-08 12:56 UTC (History)
4 users (show)

Fixed In Version: python-aiofiles-0.7.0-1.fc35
Doc Type: If docs needed, set a value
Doc Text:
Clone Of:
Environment:
Last Closed: 2021-06-08 12:56:32 UTC
Type: Bug
Embargoed:


Attachments (Terms of Use)

Description Tomáš Hrnčiar 2020-12-10 10:33:52 UTC
python-aiofiles fails to build with Python 3.10.0a3.

=================================== FAILURES ===================================
________________________ test_serve_small_bin_file_sync ________________________

event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_serve_small_bin_file_sync0')
unused_tcp_port = 56965

    @pytest.mark.asyncio
    async def test_serve_small_bin_file_sync(event_loop, tmpdir, unused_tcp_port):
        """Fire up a small simple file server, and fetch a file.
    
        The file is read into memory synchronously, so this test doesn't actually
        test anything except the general test concept.
        """
        # First we'll write a small file.
        filename = "test.bin"
        file_content = b"0123456789"
        file = tmpdir.join(filename)
        file.write_binary(file_content)
    
        async def serve_file(reader, writer):
            full_filename = str(file)
            with open(full_filename, "rb") as f:
                writer.write(f.read())
            writer.close()
    
>       server = await asyncio.start_server(
            serve_file, port=unused_tcp_port, loop=event_loop
        )

tests/test_simple.py:26: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client_connected_cb = <function test_serve_small_bin_file_sync.<locals>.serve_file at 0x7f2790f5b280>
host = None, port = 56965, limit = 65536
kwds = {'loop': <_UnixSelectorEventLoop running=False closed=False debug=False>}
factory = <function start_server.<locals>.factory at 0x7f2790f5b310>

    async def start_server(client_connected_cb, host=None, port=None, *,
                           limit=_DEFAULT_LIMIT, **kwds):
        """Start a socket server, call back for each client connected.
    
        The first parameter, `client_connected_cb`, takes two parameters:
        client_reader, client_writer.  client_reader is a StreamReader
        object, while client_writer is a StreamWriter object.  This
        parameter can either be a plain callback function or a coroutine;
        if it is a coroutine, it will be automatically converted into a
        Task.
    
        The rest of the arguments are all the usual arguments to
        loop.create_server() except protocol_factory; most common are
        positional host and port, with various optional keyword arguments
        following.  The return value is the same as loop.create_server().
    
        Additional optional keyword arguments are loop (to set the event loop
        instance to use) and limit (to set the buffer limit passed to the
        StreamReader).
    
        The return value is the same as loop.create_server(), i.e. a
        Server object which can be used to stop the service.
        """
        loop = events.get_running_loop()
    
        def factory():
            reader = StreamReader(limit=limit, loop=loop)
            protocol = StreamReaderProtocol(reader, client_connected_cb,
                                            loop=loop)
            return protocol
    
>       return await loop.create_server(factory, host, port, **kwds)
E       TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop'

/usr/lib64/python3.10/asyncio/streams.py:84: TypeError
__________________________ test_serve_small_bin_file ___________________________

event_loop = <_UnixSelectorEventLoop running=False closed=False debug=False>
tmpdir = local('/tmp/pytest-of-mockbuild/pytest-0/test_serve_small_bin_file0')
unused_tcp_port = 38719

    @pytest.mark.asyncio
    async def test_serve_small_bin_file(event_loop, tmpdir, unused_tcp_port):
        """Fire up a small simple file server, and fetch a file."""
        # First we'll write a small file.
        filename = "test.bin"
        file_content = b"0123456789"
        file = tmpdir.join(filename)
        file.write_binary(file_content)
    
        async def serve_file(reader, writer):
            full_filename = str(file)
            f = await threadpool.open(full_filename, mode="rb")
            writer.write((await f.read()))
            await f.close()
            writer.close()
    
>       server = await asyncio.start_server(
            serve_file, port=unused_tcp_port, loop=event_loop
        )

tests/test_simple.py:57: 
_ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ 

client_connected_cb = <function test_serve_small_bin_file.<locals>.serve_file at 0x7f2790f5b9d0>
host = None, port = 38719, limit = 65536
kwds = {'loop': <_UnixSelectorEventLoop running=False closed=False debug=False>}
factory = <function start_server.<locals>.factory at 0x7f2790f5ba60>

    async def start_server(client_connected_cb, host=None, port=None, *,
                           limit=_DEFAULT_LIMIT, **kwds):
        """Start a socket server, call back for each client connected.
    
        The first parameter, `client_connected_cb`, takes two parameters:
        client_reader, client_writer.  client_reader is a StreamReader
        object, while client_writer is a StreamWriter object.  This
        parameter can either be a plain callback function or a coroutine;
        if it is a coroutine, it will be automatically converted into a
        Task.
    
        The rest of the arguments are all the usual arguments to
        loop.create_server() except protocol_factory; most common are
        positional host and port, with various optional keyword arguments
        following.  The return value is the same as loop.create_server().
    
        Additional optional keyword arguments are loop (to set the event loop
        instance to use) and limit (to set the buffer limit passed to the
        StreamReader).
    
        The return value is the same as loop.create_server(), i.e. a
        Server object which can be used to stop the service.
        """
        loop = events.get_running_loop()
    
        def factory():
            reader = StreamReader(limit=limit, loop=loop)
            protocol = StreamReaderProtocol(reader, client_connected_cb,
                                            loop=loop)
            return protocol
    
>       return await loop.create_server(factory, host, port, **kwds)
E       TypeError: BaseEventLoop.create_server() got an unexpected keyword argument 'loop'

/usr/lib64/python3.10/asyncio/streams.py:84: TypeError
=============================== warnings summary ===============================
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
/builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10
  /builddir/build/BUILDROOT/python-aiofiles-0.5.0-2.fc34.x86_64/usr/lib/python3.10/site-packages/aiofiles/os.py:10: DeprecationWarning: "@coroutine" decorator is deprecated since Python 3.8, use "async def" instead
    def run(*args, loop=None, executor=None, **kwargs):

-- Docs: https://docs.pytest.org/en/stable/warnings.html
=========================== short test summary info ============================
FAILED tests/test_simple.py::test_serve_small_bin_file_sync - TypeError: Base...
FAILED tests/test_simple.py::test_serve_small_bin_file - TypeError: BaseEvent...
================== 2 failed, 135 passed, 6 warnings in 1.75s ===================

For the build logs, see:
https://copr-be.cloud.fedoraproject.org/results/@python/python3.10/fedora-rawhide-x86_64/01819231-python-aiofiles/

For all our attempts to build python-aiofiles with Python 3.10, see:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/package/python-aiofiles/

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.10:
https://copr.fedorainfracloud.org/coprs/g/python/python3.10/

Let us know here if you have any questions.

Python 3.10 will be included in Fedora 35. To make that update smoother, we're building Fedora packages with early pre-releases of Python 3.10.
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 Ben Cotton 2021-02-09 15:33:09 UTC
This bug appears to have been reported against 'rawhide' during the Fedora 34 development cycle.
Changing version to 34.

Comment 2 Miro Hrončok 2021-06-04 20:14:03 UTC
This is a mass-posted update. Sorry if it is not 100% accurate to this bugzilla.


The Python 3.10 rebuild is in progress in a Koji side tag. If you manage to fix the problem, please commit the fix in the rawhide branch, but don't build the package in regular rawhide.

You can either build the package in the side tag, with:

    $ fedpkg build --target=f35-python

Or you can the build and we will eventually build it for you.

Note that the rebuild is still in progress, so not all (build) dependencies of this package might be available right away.

Thanks.

See also https://fedoraproject.org/wiki/Changes/Python3.10

If you have general questions about the rebuild, please use this mailing list thread: https://lists.fedoraproject.org/archives/list/devel@lists.fedoraproject.org/thread/G47SGOYIQLRDTWGOSLSWERZSSHXDEDH5/

Comment 3 Ben Beasley 2021-06-07 14:59:39 UTC
This PR updates to 0.7.0, which fixes this and https://bugzilla.redhat.com/show_bug.cgi?id=1823140: https://src.fedoraproject.org/rpms/python-aiofiles/pull-request/1

Comment 4 Miro Hrončok 2021-06-07 22:58:44 UTC
The f35-python side tag has been merged to Rawhide. From now on, build as you would normally build.

Comment 5 Miro Hrončok 2021-06-08 11:21:09 UTC
*** Bug 1968885 has been marked as a duplicate of this bug. ***

Comment 6 Fedora Update System 2021-06-08 12:54:59 UTC
FEDORA-2021-8ee839daeb has been submitted as an update to Fedora 35. https://bodhi.fedoraproject.org/updates/FEDORA-2021-8ee839daeb

Comment 7 Fedora Update System 2021-06-08 12:56:32 UTC
FEDORA-2021-8ee839daeb has been pushed to the Fedora 35 stable repository.
If problem still persists, please make note of it in this bug report.


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