pysigset
Signal blocking under Linux & OS X
What it is and what it does
pysigset wraps POSIX signal masking functions (sigprocmask, sigaddset, sigdelset, and others) to let Python developers temporarily block signals during critical sections of code. It provides both low-level access to individual signal set operations and a high-level context manager (suspended_signals) for convenient signal blocking.
The package uses ctypes to call libc functions directly, avoiding compilation requirements. It supports Linux and macOS. However, the project has been abandoned since 2021-05-03 and shows no recent activity, raising questions about compatibility with modern Python versions and current system libraries.
Use it for:
- Block SIGTERM and SIGINT during database transactions or file writes to prevent partial updates.
- Temporarily suspend signals while manipulating shared state in multi-threaded applications.
- Prevent signal interruption during cleanup code or resource deallocation.
- Implement graceful shutdown logic that defers signal handling until a safe point.
Worth the install?
AI-flagged interpretation of the facts on this page — verify before relying
Provides Python access to POSIX signal masking via sigprocmask(2) and related system calls, allowing you to block and unblock signals in critical code sections on Linux and macOS.
No. The package is abandoned (last commit 2021-05-03) and untested on modern Python versions. While the core functionality is simple and has no external dependencies, the lack of maintenance creates risk for compatibility issues with current Python, libc, and macOS versions. Consider alternatives or inline ctypes calls if signal masking is critical.
Install
pysigset on PyPI
pip
pip install pysigsetuv
uv add pysigsetpoetry
poetry add pysigsetInstalling pysigset
Before you install
High install friction: the package relies on ctypes access to libc.so.6 (Linux) or libSystem.B.dylib (macOS) and has been abandoned since the last commit on 2021-05-03 with no maintenance activity since then. No runtime dependencies, but platform-specific system library availability is required.
License in practice
Licensed under LGPLv3+, a copyleft license. You may use and modify the package freely, but any derivative work must also be distributed under the same or compatible license terms.
Quickstart
from signal import SIGINT, SIGTERM
from pysigset import suspended_signals
with suspended_signals(SIGINT, SIGTERM):
# Signals are blocked here
pass
Requires Linux or macOS; ctypes must be able to locate libc.so.6 (Linux) or libSystem.B.dylib (macOS).
Verify before relying
- Whether the package works reliably on current Python versions given no maintenance since 2021-05-03.
- Compatibility with modern libc implementations and macOS versions.
- Whether ctypes-based access to libc remains stable across system updates.
Package facts
| License | LGPLv3+ (copyleft) |
| Python support | not specified |
| Install friction | high — source build required |
| Runtime dependencies | none |
| Maintenance | abandoned — 1,929 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 90,001/month — #13,622 on PyPI (30-day window, as of 2026-08-14) |
| Known vulnerabilities | none known (OSV.dev, checked 2026-08-14) |
Evidence: pysigset-0.4.0.tar.gz
Tags
More Libraries packages
urllib3 is an HTTP client library that provides…
permissive · top 100 on PyPI
requestsRequests is a Python HTTP library that…
permissive · top 100 on PyPI
pluggyPluggy provides a plugin system that lets you…
permissive · top 100 on PyPI
python-dateutilProvides parsing, arithmetic, and recurrence…
permissive · top 100 on PyPI
sixSix provides utility functions to write Python…
permissive · top 100 on PyPI
pytestpytest is a testing framework that lets you…
permissive · top 100 on PyPI
cpuset-py3Wraps Linux cpuset kernel facilities through…
unclear · top 15,000 on PyPI
lib-cli-exit-toolsProvides portable signal handling,…
permissive · top 15,000 on PyPI
cysignalsProvides interrupt and signal handling…
copyleft · top 15,000 on PyPI
pytest-timeoutsA pytest plugin that enforces separate timeout…
permissive · top 5,000 on PyPI
aiosignalProvides a Signal class for managing lists of…
permissive · top 100 on PyPI
psygnalPsygnal implements the observer pattern with a…
permissive · top 5,000 on PyPI
pyPPGAnalyzes finger photoplethysmogram (PPG)…
agpl · top 15,000 on PyPI
neurokit2NeuroKit2 processes physiological signals (ECG,…
permissive · top 15,000 on PyPI
pyobjc-framework-FSEventsProvides Python bindings to macOS's FSEvents…
permissive · top 15,000 on PyPI
pyobjc-framework-CryptoTokenKitProvides Python bindings to macOS's…
permissive · top 15,000 on PyPI