pathlib2
Object-oriented filesystem paths
Decision gist · record as of 2026-08-14
No, unless you are maintaining legacy Python 2.7 or very early Python 3 code. Modern Python versions include pathlib in the standard library; use that instead. The package is stable and permissively licensed, but dormant maintenance and the availability of built-in pathlib make it unnecessary for new projects.AI-flagged interpretation of the facts on this page — verify before relying
Before you install
- Intended for Python 2.7 and early Python 3.x; modern Python versions include pathlib in the standard library and should use that instead.
- Low install friction with a pure-Python wheel.
- Dormant maintenance status—last release was 2022-02-10 and last commit 2023-09-29—but the package is stable and tracks the standard library, so updates are infrequent by design.
License · maintenance · safety
MIT (permissive) — MIT license (permissive) allows use in commercial and open-source projects with minimal restrictions.
last release 2022-02-10 (1646 days) · last repo commit 2023-09-29 · 86 stars
0 known vulnerabilities (OSV.dev, 2026-08-14) · 4,426,297 downloads/mo, #2,304 on PyPI
Alternatives
Verify before relying
pip install pathlib2
from pathlib2 import Path
p = Path('/home/user/file.txt')
print(p.exists())- Whether the package is still actively maintained or if it is effectively superseded by the standard library pathlib.
- Current compatibility with Python versions beyond 3.9 and whether the package is tested against modern releases.
- Whether the Windows Python 2.7 unicode filename issue (issue #56) remains unfixed and affects current users.
What it is and what it does
pathlib2 is a backport of Python's standard pathlib module, designed to bring modern path-handling APIs to older Python versions that predate pathlib's inclusion in the standard library. It provides an object-oriented interface for working with filesystem paths across platforms, replacing string-based path manipulation with a cleaner, more intuitive API. The package depends on six, scandir, and typing to maintain compatibility across Python 2.7 and early Python 3 releases.
The backport tracks the standard library's pathlib implementation, so features added to the standard module are eventually available through pathlib2 on older Python versions. However, it carries a known limitation: on Windows with Python 2.7, non-ASCII filename characters may be silently corrupted due to the platform's filesystem encoder having poor Unicode support. Development now occurs primarily in the Python standard library itself, making this package a maintenance-light compatibility shim rather than an actively developed project.
Use it for
- Migrate legacy Python 2.7 codebases to use modern pathlib syntax before upgrading to Python 3.
- Maintain a single codebase across Python 2.7 and early Python 3.x versions using consistent path APIs.
- Use pathlib's object-oriented path interface in projects that must support Python 3.5 or 3.6.
- Backport pathlib features to environments where the standard library version is unavailable or outdated.
Worth the install?
AI-flagged interpretation of the facts on this page. Verify before relying on it.
No, unless you are maintaining legacy Python 2.7 or very early Python 3 code.
Modern Python versions include pathlib in the standard library; use that instead. The package is stable and permissively licensed, but dormant maintenance and the availability of built-in pathlib make it unnecessary for new projects.
Install
pathlib2 on PyPI
Before you install
Low install friction with a pure-Python wheel. Dormant maintenance status—last release was 2022-02-10 and last commit 2023-09-29—but the package is stable and tracks the standard library, so updates are infrequent by design.
Intended for Python 2.7 and early Python 3.x; modern Python versions include pathlib in the standard library and should use that instead.
License in practice
MIT license (permissive) allows use in commercial and open-source projects with minimal restrictions.
Quickstart
pip install pathlib2
from pathlib2 import Path
p = Path('/home/user/file.txt')
print(p.exists())
Verify before relying
- Whether the package is still actively maintained or if it is effectively superseded by the standard library pathlib.
- Current compatibility with Python versions beyond 3.9 and whether the package is tested against modern releases.
- Whether the Windows Python 2.7 unicode filename issue (issue #56) remains unfixed and affects current users.
Package facts
| License | MIT permissive |
| Python support | Not specified |
| Install friction | Low. Pure-Python wheel |
| Runtime dependencies | 3 packagessixscandirtyping |
| Maintenance | Dormant 1,646 days since the last release |
| Last repo commit | |
| First released | |
| Downloads | 4,426,297 / month, #2,304 on PyPI 30-day window, as of 2026-08-14 |
| Known vulnerabilities | None known OSV.dev, checked 2026-08-14 |
| Classifiers | Development Status :: 5 - Production/StableIntended Audience :: DevelopersLicense :: OSI Approved :: MIT LicenseOperating System :: OS IndependentProgramming Language :: PythonProgramming Language :: Python :: 2Programming Language :: Python :: 2.7Programming Language :: Python :: 3Programming Language :: Python :: 3.5Programming Language :: Python :: 3.6Programming Language :: Python :: 3.7Programming Language :: Python :: 3.8Programming Language :: Python :: 3.9Topic :: Software Development :: LibrariesTopic :: System :: Filesystems |
Evidence: pathlib2-2.3.7.post1-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 › “pathlib backport”
- pathlib2Backport of Python's standard pathlib module for older Python…
- pathlib3xBackport of Python 3.11 pathlib to Python 3.8+ with extensions like…
- zippProvides a pathlib-compatible wrapper around zipfile objects, letting…
Give your agent the search over MCP, or paste the wish link into any chat.
More Libraries packages
urllib3 is an HTTP client library that provides thread-safe connection pooling, SSL/TLS verification, multipart file uploads, request retries, compression support, and proxy handling for Python applications.
Requests is a Python HTTP library that simplifies sending HTTP/1.1 requests with automatic handling of headers, authentication, cookies, and response parsing.
Pluggy provides a plugin system that lets you define hook specifications and register implementations to be called in sequence, enabling extensible Python applications without tight coupling.
Install it if you're building an extensible application or framework.
Provides parsing, arithmetic, and recurrence rule computation for dates and times, with timezone support and iCalendar RFC compliance.
Install it if you need to parse flexible date strings, compute relative dates, handle timezones, or work with recurrence rules—it's the de facto choice for these tasks.
Six provides utility functions to write Python code that runs on both Python 2.7 and Python 3.3+, smoothing over language differences between the two versions.
pytest is a testing framework that lets you write test functions using plain assert statements and automatically discovers and runs them, with detailed failure reporting.
See also pathlib · pathlib3x · py · path.py · pathlib-abc · traceback2 · urlpath · path · configparser2 · artifactory