skillfed

pysigset

Signal blocking under Linux & OS X

pysigset v0.4.0 90.0K downloads/30d#13,622 on PyPI12
Copyleft license LGPLv3+ Abandoned released

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 pysigset

uv

uv add pysigset

poetry

poetry add pysigset

Installing 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

Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: GNU Lesser General Public License v3 or later (LGPLv3+)Operating System :: MacOS :: MacOS XOperating System :: POSIX :: LinuxProgramming Language :: Python :: 2Programming Language :: Python :: 3Topic :: Software Development :: Libraries

Tags

signal blocking pythonsigprocmask wrapperblock signals linux macoscritical section signal handlingPOSIX signal maskingsuspend signals context manager
signal-handlingposix-systemsabandoned

More Libraries packages