--- id: backports-tempfile version: "1.0" license: Python Software Foundation License license_treatment: permissive maintenance: abandoned --- # backports.tempfile — Backport of new features in Python's tempfile module License: permissive · Maintenance: abandoned · Downloads: 1.2M/mo ## What it is and what it does backports.tempfile backports the TemporaryDirectory context manager from Python's standard tempfile module to older Python versions that lack it. TemporaryDirectory is a context manager that creates a temporary directory and automatically cleans it up when the context exits. This package targets Python 2.7, 3.4, 3.5, and 3.6. It has no runtime dependencies and installs with low friction. However, the package is abandoned—no releases since 2017-10-13 and no commits since 2019-04-02. It is only relevant if you are maintaining legacy code that must run on these old Python versions. Use it for: - Legacy Python 2.7 codebases that need safe temporary directory handling without manual cleanup. - Supporting Python 3.4 or 3.5 applications where TemporaryDirectory is not yet available in the standard library. - Unified code that must run on both Python 2 and early Python 3 versions using a single import. - Migrating older projects away from manual tempfile cleanup logic to a context-manager approach. ## Worth the install? AI-flagged interpretation of the facts above — verify before relying. Provides the TemporaryDirectory context manager for Python 2.7 and early Python 3 versions that lack it in their standard library. No, unless you are actively maintaining legacy code on Python 2.7, 3.4, or 3.5. The package is abandoned (last release 2017-10-13, last commit 2019-04-02) and unnecessary for any modern Python project. If you do need it for legacy support, it installs cleanly with no dependencies, but expect no future maintenance or security updates. ## Install pip install backports-tempfile uv add backports-tempfile poetry add backports-tempfile ## Installing backports.tempfile Before you install: Low install friction with no runtime dependencies. However, the package is abandoned—last release was 2017-10-13 and last commit 2019-04-02. Only relevant if you must support Python 2.7, 3.4, or 3.5. License in practice: Licensed under Python Software Foundation License (permissive). No restrictions on use or redistribution in typical commercial or open-source contexts. Quickstart: pip install backports.tempfile from backports.tempfile import TemporaryDirectory with TemporaryDirectory() as tmpdir: # Use tmpdir for temporary files pass Only useful on Python 2.7, 3.4, 3.5, or 3.6 where TemporaryDirectory is not available in the standard library. Verify before relying: - Whether the backport's TemporaryDirectory behavior exactly matches the standard library implementation across all tested versions. - Whether this backport remains compatible with Python versions beyond 3.6 despite classifiers stopping there. ## Package facts - License: Python Software Foundation License (permissive) - Python support: unspecified - Install friction: low - Maintenance: abandoned - Downloads: 1.2M/month (top 5,000 on PyPI) - Known vulnerabilities: none known ## Tags temporary directory context manager, backport tempfile python 2.7, TemporaryDirectory older python, temporary file handling, python 2 tempfile backport, legacy-support, python-2 [View on SkillFed](https://skillfed.io/packages/backports-tempfile) · [View on PyPI](https://pypi.org/project/backports-tempfile/)