Repository navigation
Add support for Python 3.12 to Uvloop #547
Copy link
Copy link
Closed
Description
- uvloop version: uvloop-0.17.0
- Python version: 3.12.0b3
- Platform: Fedora Linux Rawhide
- Can you reproduce the bug with
PYTHONASYNCIODEBUGin env?: N/A - Does uvloop behave differently from vanilla asyncio? How?: N/A
Uvloop's test suite currently fails on Python 3.12:
======================================================================
ERROR: test_aiohttp_graceful_shutdown (tests.test_aiohttp.Test_AIO_AioHTTP.test_aiohttp_graceful_shutdown)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/usr/lib64/python3.12/asyncio/tasks.py", line 510, in wait_for
return await fut
^^^^^^^^^
File "/usr/lib64/python3.12/site-packages/aiohttp/web_runner.py", line 293, in cleanup
await site.stop()
File "/usr/lib64/python3.12/site-packages/aiohttp/web_runner.py", line 75, in stop
await self._server.wait_closed()
File "/usr/lib64/python3.12/asyncio/base_events.py", line 384, in wait_closed
await waiter
asyncio.exceptions.CancelledError
The above exception was the direct cause of the following exception:
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_aiohttp.py", line 101, in test_aiohttp_graceful_shutdown
self.loop.run_until_complete(stop())
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_aiohttp.py", line 93, in stop
await asyncio.wait_for(runner.cleanup(), timeout=0.1)
File "/usr/lib64/python3.12/asyncio/tasks.py", line 509, in wait_for
async with timeouts.timeout(timeout):
File "/usr/lib64/python3.12/asyncio/timeouts.py", line 111, in __aexit__
raise TimeoutError from exc_val
TimeoutError
======================================================================
ERROR: test_libuv_get_loop_t_ptr (tests.test_libuv_api.Test_UV_libuv.test_libuv_get_loop_t_ptr)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_libuv_api.py", line 12, in test_libuv_get_loop_t_ptr
import pyximport
File "/usr/lib64/python3.12/site-packages/pyximport/__init__.py", line 1, in <module>
from .pyximport import *
File "/usr/lib64/python3.12/site-packages/pyximport/pyximport.py", line 51, in <module>
import imp
ModuleNotFoundError: No module named 'imp'
======================================================================
ERROR: test_process_double_close (tests.test_process.Test_UV_Process.test_process_double_close)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_process.py", line 867, in test_process_double_close
subprocess.run([sys.executable, '-c', script], check=True)
File "/usr/lib64/python3.12/subprocess.py", line 571, in run
raise CalledProcessError(retcode, process.args,
subprocess.CalledProcessError: Command '['/usr/bin/python3', '-c', '\nimport os\nimport sys\nfrom unittest import mock\n\nimport asyncio\n\npipes = []\noriginal_os_pipe = os.pipe\ndef log_pipes():\n pipe = original_os_pipe()\n pipes.append(pipe)\n return pipe\n\ndups = []\noriginal_os_dup = os.dup\ndef log_dups(*args, **kwargs):\n dup = original_os_dup(*args, **kwargs)\n dups.append(dup)\n return dup\n\nwith mock.patch(\n "os.close", wraps=os.close\n) as os_close, mock.patch(\n "os.pipe", new=log_pipes\n), mock.patch(\n "os.dup", new=log_dups\n):\n import uvloop\n\n\nasync def test():\n proc = await asyncio.create_subprocess_exec(\n sys.executable, "-c", "pass"\n )\n await proc.communicate()\n\nuvloop.install()\nasyncio.run(test())\n\nstdin, stdout, stderr = dups\n(r, w), = pipes\nassert os_close.mock_calls == [\n mock.call(w),\n mock.call(r),\n mock.call(stderr),\n mock.call(stdout),\n mock.call(stdin),\n]\n']' returned non-zero exit status 1.
======================================================================
FAIL: test_create_server_1 (tests.test_tcp.Test_AIO_TCP.test_create_server_1)
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 177, in test_create_server_1
self.loop.run_until_complete(start_server())
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 138, in start_server
self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 29 != -1
======================================================================
FAIL: test_create_server_3 (tests.test_tcp.Test_AIO_TCP.test_create_server_3)
check ephemeral port can be used
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 214, in test_create_server_3
self.loop.run_until_complete(start_server_ephemeral_ports())
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_tcp.py", line 210, in start_server_ephemeral_ports
self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 29 != -1
======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_unix_server(host, port)')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 129, in test_create_unix_server_1
self.loop.run_until_complete(start_server())
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 86, in start_server
self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 29 != -1
======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_unix_server(sock)')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 133, in test_create_unix_server_1
self.loop.run_until_complete(start_server_sock(
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 121, in start_server_sock
self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 29 != -1
======================================================================
FAIL: test_create_unix_server_1 (tests.test_unix.Test_AIO_Unix.test_create_unix_server_1) (func='start_server(sock)')
----------------------------------------------------------------------
Traceback (most recent call last):
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 141, in test_create_unix_server_1
self.loop.run_until_complete(start_server_sock(
File "/usr/lib64/python3.12/asyncio/base_events.py", line 664, in run_until_complete
return future.result()
^^^^^^^^^^^^^^^
File "/builddir/build/BUILD/uvloop-0.17.0/tests/test_unix.py", line 121, in start_server_sock
self.assertEqual(srv_sock.fileno(), -1)
AssertionError: 29 != -1
----------------------------------------------------------------------
Ran 506 tests in 121.799s
FAILED (failures=5, errors=3, skipped=33)
Test failed: <unittest.runner.TextTestResult run=506 errors=3 failures=5>
error: Test failed: <unittest.runner.TextTestResult run=506 errors=3 failures=5>
Please add Python 3.12 support.
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Activity
Skip tests that fail on Python 3.12
Skip tests that fail on Python 3.12
fantix commentedon Oct 15, 2023
Added in #570 and uvloop 0.18