--- id: selectors2 version: "2.0.2" license: MIT license_treatment: permissive maintenance: abandoned --- # selectors2 — Back-ported, durable, and portable selectors License: permissive · Maintenance: abandoned · Downloads: 159.3K/mo ## What it is and what it does Selectors2 is a backport of Python's selectors module designed for older Python versions (2.6–3.4) and Jython. It provides a unified API for monitoring file descriptors (sockets and pipes) for I/O readiness across different operating systems by selecting the best available selector type—epoll on Linux, kqueue on BSD/macOS, poll on some Unix systems, or the portable select() fallback. The package implements PEP 475 to handle interrupted system calls gracefully, retrying rather than returning spurious empty events. The module is a drop-in replacement for the standard library selectors module and was originally developed to solve real-world durability and portability problems. It supports monkey-patching scenarios and detects systems that claim to support a selector but don't actually implement it. However, the package has been abandoned since July 21, 2020 and receives no maintenance; modern Python users should use the standard library selectors module instead. Use it for: - Porting async I/O code to Python 2.6–3.4 environments where the standard selectors module is unavailable or incomplete. - Building network libraries that need robust selector support across Linux, macOS, Windows, and Jython without external async frameworks. - Handling interrupted system calls reliably in older Python versions that predate PEP 475. - Monitoring multiple sockets or pipes for read/write events in legacy applications that cannot upgrade Python versions. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides a backported, cross-platform replacement for Python's standard library selectors module, supporting multiple selector types (epoll, kqueue, poll, select) across Linux, macOS, Windows, and Jython. No, unless you are maintaining legacy Python 2.6–3.4 code that requires selector functionality and cannot use the standard library module. The package is abandoned (last release July 21, 2020, repository archived) and receives no security or maintenance updates. Modern Python users should use the standard library selectors module instead. ## Install pip install selectors2 uv add selectors2 poetry add selectors2 ## Installing selectors2 Before you install: Low install friction with no runtime dependencies. However, the package is abandoned as of July 21, 2020 and its repository is archived. Use only if you need Python 2.6–3.4 support or cannot upgrade to the standard library selectors module. License in practice: Dual-licensed under MIT and PSF License, both permissive. You may use, modify, and distribute this package freely in commercial or private projects with minimal restrictions. Quickstart: import selectors2 as selectors s = selectors.DefaultSelector() import socket sock = socket.socket(socket.AF_INET, socket.SOCK_STREAM) s.register(sock, selectors.EVENT_WRITE) events = s.select(timeout=1.0) for key, event in events: if event & selectors.EVENT_WRITE: key.fileobj.send(b'data') Requires a platform with a selector available (select.select, epoll, kqueue, poll, or devpoll); raises RuntimeError on platforms without any selector. Verify before relying: - Whether PEP 475 interrupt-retry behavior remains necessary in modern Python versions. - Current real-world adoption outside of legacy Python 2 codebases. - Compatibility with Python versions beyond 3.4 despite abandonment. ## Package facts - License: MIT (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 159.3K/month (top 15,000 on PyPI) - Known vulnerabilities: none known ## Tags backported selectors module, cross-platform socket selection, epoll kqueue poll select, async I/O selector, file descriptor monitoring, python 2 selectors backport, portable event loop selector, backport, legacy-python, abandoned [View on SkillFed](https://skillfed.io/packages/selectors2) · [View on PyPI](https://pypi.org/project/selectors2/)