# PyKCS11 1.5.21 fixes spurious debug mechanism, adds Python 3.15 wheels

> **Key takeaway:** The Python PKCS#11 wrapper removes an erroneous debug mechanism from release 1.5.19 and begins distributing pre-built wheels for Python 3.15.

**Published:** 2026-10-31T13:20:03+00:00 
**Source:** Planet Debian (Developer Blogs) 
**Category:** distro-planet 
**Canonical URL:** https://fosswire.org/news/pykcs11-1521-fixes-spurious-debug-mechanism-adds-python-315-.html 

## Summary
Ludovic Rousseau has released PyKCS11 1.5.21, a maintenance update to the Python wrapper for the PKCS#11 cryptographic token API. The release corrects a regression introduced in version 1.5.19 where getMechanismList() incorrectly returned mechanism 0x1D, a debug code that was never meant for production. The build system now also generates binary wheels for Python 3.15, expanding platform support for the cryptographic library.

PyKCS11 enables Python applications to interact with hardware security modules, smart cards, and other PKCS#11-compliant cryptographic devices. The fix restores correct behavior for applications that enumerate supported cryptographic mechanisms, while the new wheel support simplifies deployment for developers on the upcoming Python release.

## What changed in PyKCS11 1.5.21
- **getMechanismList() fix:** The method no longer returns mechanism 0x1D, which was debug code accidentally included in release 1.5.19 that could cause incorrect capability detection in applications enumerating token mechanisms.
- **Python 3.15 binary wheels:** The project now builds and distributes pre-compiled binary wheels for Python 3.15, reducing installation friction and eliminating the need for users to compile the C extension from source on the new Python version.
- **PKCS#11 API wrapper scope:** PyKCS11 remains a thin Python binding over the standard PKCS#11 API, used for smart card and HSM integration in applications requiring cryptographic operations with hardware-backed key storage.

## Why it matters
The mechanism list fix prevents downstream applications from misidentifying supported cryptographic capabilities, which is critical for security-sensitive code paths that depend on accurate HSM or smart card feature detection. Python 3.15 wheel support ensures the library remains accessible as distributions begin packaging the new Python release, maintaining PyKCS11's role in the open-source cryptographic tooling chain for Debian and other Linux distributions.