lockfile
Platform-independent file locking module
Decision gist · record as of 2026-08-14
No. The package is formally deprecated and abandoned (last release 2015-11-25). The maintainers explicitly recommend fasteners or oslo.concurrency instead. While it has no known vulnerabilities and installs with zero friction, its age and lack of maintenance make it unsuitable for new projects. Only install if you are maintaining legacy code that already depends on it.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Installation is frictionless (pure Python wheel, no runtime dependencies), but the package is abandoned—last release was in 2015.
- The maintainers explicitly recommend using fasteners or oslo.concurrency instead for new code.
License · maintenance · safety
permissive license (permissive) — Licensed under MIT (permissive), so there are no restrictions on use, modification, or distribution in proprietary or open-source projects.
last release 2015-11-25 (3915 days)
0 known vulnerabilities (OSV.dev, 2026-08-14) · 33,168,445 downloads/mo, #768 on PyPI
Alternatives
Verify before relying
from lockfile import LockFile
with LockFile('/tmp/mylock'):
# Critical section: file is locked
pass- Whether the package still works reliably with modern Python versions (classifiers list Python 2.7 and 3.3, both long unsupported)
- Current status of the OpenStack project repository and whether it is still accessible
- Whether fasteners or oslo.concurrency have fully superseded all use cases this package covered
What it is and what it does
lockfile is a deprecated file-locking library that abstracts platform differences between Unix and Windows. It exports a LockFile class with a simple context-manager API for acquiring exclusive file locks using atomic filesystem operations—link() on Unix systems and mkdir() on Windows. The lock mechanism is portable: the same code works identically across Linux, macOS, Windows, and other POSIX systems without needing platform-specific fcntl or msvcrt calls.
The package also provides alternative implementations (LinkFileLock, MkdirFileLock, SQLiteFileLock) for different locking strategies. However, the maintainers have formally deprecated it in favor of fasteners or oslo.concurrency, and the codebase has not been updated since 2015. It remains in the top 1000 most-downloaded packages by legacy adoption, but is not recommended for new projects.
Use it for
- Legacy codebases that already depend on lockfile and need to maintain compatibility without refactoring to a newer locking library.
- Simple scripts requiring cross-platform file locking without adding heavyweight dependencies.
- Educational purposes to understand how file locking abstractions can bridge Unix and Windows APIs.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No.
The package is formally deprecated and abandoned (last release 2015-11-25). The maintainers explicitly recommend fasteners or oslo.concurrency instead. While it has no known vulnerabilities and installs with zero friction, its age and lack of maintenance make it unsuitable for new projects. Only install if you are maintaining legacy code that already depends on it.
Install
lockfile on PyPI
Before you install
Installation is frictionless (pure Python wheel, no runtime dependencies), but the package is abandoned—last release was in 2015. The maintainers explicitly recommend using fasteners or oslo.concurrency instead for new code.
License in practice
Licensed under MIT (permissive), so there are no restrictions on use, modification, or distribution in proprietary or open-source projects.
Quickstart
from lockfile import LockFile
with LockFile('/tmp/mylock'):
# Critical section: file is locked
pass
Verify before relying
- Whether the package still works reliably with modern Python versions (classifiers list Python 2.7 and 3.3, both long unsupported)
- Current status of the OpenStack project repository and whether it is still accessible
- Whether fasteners or oslo.concurrency have fully superseded all use cases this package covered
Package facts
| License | permissive license permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | None |
| Maintenance | Abandoned 3,915 days since the last release |
| First released | |
| Downloads | 33,168,445 / month, #768 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Intended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: MacOSOperating System :: Microsoft :: Windows :: Windows NT/2000Operating System :: POSIXOperating System :: POSIX :: LinuxProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.3Topic :: Software Development :: Libraries :: Python Modules |
Evidence: lockfile-0.12.2-py2.py3-none-any.whl
Tags
Let your AI agent find packages like this
Example. Real query, live index.
You found this page by searching. An agent finds it by wishing: SkillFed indexes 14,416 PyPI packages by what they can do, searchable in plain language.
wish › “atomic file lock unix windows”
- lockfileProvides a platform-independent file locking API that works…
- flufl.lockProvides NFS-safe file locking with timeout support across POSIX and…
- portalockerPortalocker provides cross-platform file locking with support for…
Give your agent the search over MCP, or paste the wish link into any chat.
More Python Modules packages
Converts domain names between Unicode and ASCII-compatible encoding (Punycode) according to IDNA 2008 and Unicode Technical Standard 46, with security validation and broader script coverage than the standard library.
Install it if you work with internationalized domain names, need to validate domains, or use HTTP clients that depend on it transitively.
Setuptools is a Python build backend and package management tool that handles building, distributing, and installing Python packages, including support for C/C++ extension modules.
PyYAML parses and emits YAML 1.1 data format, enabling serialization and deserialization of configuration files and Python objects to and from human-readable YAML text.
Pydantic validates Python data structures against type hints, coercing and checking input at runtime to ensure it matches a declared schema.
Provides reusable metadata objects for use with PEP-593 `typing.Annotated` to express common constraints like bounds, collection sizes, and predicates on types.
Install it if you use or build libraries that need to express type constraints in a standardized, inspectable way—or if you want to annotate your own types with…
Provides runtime tools to inspect and introspect Python type annotations, enabling programmatic examination of type hints at execution time.
See also filelock · fasteners · oslo.concurrency · zc.lockfile · flufl.lock · pyodide-lock · locket · atomicwrites-homeassistant · psutil-home-assistant · tooz