Skip to content

Add cleanup_socket to AbstractEventLoop create_unix_server#15969

Closed
ishaanlabs-gg wants to merge 1 commit into
python:mainfrom
ishaanlabs-gg:asyncio-create-unix-server-cleanup-socket
Closed

Add cleanup_socket to AbstractEventLoop create_unix_server#15969
ishaanlabs-gg wants to merge 1 commit into
python:mainfrom
ishaanlabs-gg:asyncio-create-unix-server-cleanup-socket

Conversation

@ishaanlabs-gg

@ishaanlabs-gg ishaanlabs-gg commented Jul 1, 2026

Copy link
Copy Markdown

Fixes #15742.

asyncio.unix_events._UnixSelectorEventLoop.create_unix_server already includes the Python 3.13 cleanup_socket keyword, but asyncio.events.AbstractEventLoop.create_unix_server did not. This adds the Python 3.13+ keyword there so code typed as AbstractEventLoop can call the API without a false-positive type error.

The abstract runtime signature still lacks the keyword, so the versioned stubtest allowlists document that mismatch while keeping the concrete Unix event-loop signature checked.

Checks run:

  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python tests/regr_test.py stdlib --python-version 3.13
  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python tests/regr_test.py stdlib --python-version 3.12
  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python tests/mypy_test.py stdlib/asyncio --python-version 3.13
  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python tests/pyright_test.py stdlib/asyncio/events.pyi
  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python tests/check_typeshed_structure.py
  • PYTHONPATH=lib /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python -m mypy.stubtest --show-traceback --strict-type-check-only --custom-typeshed-dir . --ignore-unused-allowlist --allowlist stdlib/@tests/stubtest_allowlists/common.txt --allowlist stdlib/@tests/stubtest_allowlists/darwin.txt --allowlist stdlib/@tests/stubtest_allowlists/py314.txt --allowlist stdlib/@tests/stubtest_allowlists/darwin-py314.txt asyncio.events asyncio.unix_events
  • /Volumes/STOREJET/2/Dependencies/typeshed-venv/bin/python -m ruff format --check stdlib/asyncio/events.pyi stdlib/@tests/test_cases/asyncio/check_events-py313.py
  • git diff --check

Note: tests/runtests.py stdlib/asyncio --python-version 3.13 reached successful mypy/pyright/regression/structure checks locally, but the all-in-one run was not fully usable in this external-volume checkout: pre-commit hook installation generated AppleDouble ._*.dist-info metadata in its hook venv, and full stdlib stubtest also reports unrelated local Python 3.14 runtime mismatches outside asyncio (_curses, annotationlib, pyexpat).

@github-actions

github-actions Bot commented Jul 1, 2026

Copy link
Copy Markdown
Contributor

According to mypy_primer, this change has no effect on the checked open source code. 🤖🎉

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

Missing cleanup_socket argument for asyncio.events.AbstractEventLoop.create_unix_server

1 participant