History¶
v17.1.1¶
27 Jul 2025
Bugfixes¶
Fixed TempDir constructor arguments. (#236)
v17.1.0¶
28 Dec 2024
Features¶
Fully inlined the type annotations. Big thanks to SethMMorton. (#235)
v17.0.0¶
27 Jul 2024
Deprecations and Removals¶
Removed deprecated methods
getcwd,abspath,ext,listdir,isdir,isfile, andtext.Removed deprecated support for passing
bytestowrite_textandwrite_lines(linesep=)parameter.
v16.16.0¶
27 Jul 2024
Features¶
v16.15.0¶
26 Jul 2024
Features¶
Replaced ‘open’ overloads with ‘functools.wraps(open)’ for simple re-use. (#225)
Bugfixes¶
v16.14.0¶
08 Apr 2024
Features¶
v16.13.0¶
08 Apr 2024
Features¶
v16.12.1¶
04 Apr 2024
Bugfixes¶
Restore functionality in .isdir and .isfile.
v16.12.0¶
04 Apr 2024
Features¶
Added .is_dir and .is_file for parity with pathlib. Deprecates .isdir and .isfile. (#214)
v16.11.0¶
04 Apr 2024
Features¶
Inlined some types. (#215)
v16.10.2¶
04 Apr 2024
Bugfixes¶
v16.10.1¶
04 Apr 2024
Bugfixes¶
Add type annotation for iterdir. (#220)
v16.10.0¶
03 Feb 2024
Features¶
Added .with_name and .with_stem.
Prefer .suffix to .ext and deprecate .ext.
v16.9.0¶
04 Dec 2023
Features¶
Added
.iterdir()and deprecated.listdir(). (#214)
v16.8.0¶
04 Dec 2023
Features¶
Use ‘.’ as the default path. (#216)
v16.7.1¶
06 Jul 2023
Bugfixes¶
Set
stacklevel=2in deprecation warning for.text. (#210)
v16.7.0¶
06 Jul 2023
Features¶
Added
.permissionsattribute. (#211)Require Python 3.8 or later.
v16.6.0¶
30 Nov 2022
.mtimeand.atimeare now settable.
v16.5.0¶
25 Sep 2022
v16.4.0¶
25 Feb 2022
#207: Added type hints and declare the library as typed.
v16.3.0¶
06 Jan 2022
Require Python 3.7 or later.
#205: test_listdir_other_encoding now automatically skips itself on file systems where it’s not appropriate.
v16.2.0¶
25 Jul 2021
Deprecated passing bytes to
write_text. Instead, users should callwrite_bytes.
v16.1.0¶
25 Jul 2021
#204: Improved test coverage across the package to 99%, fixing bugs in uncovered code along the way.
v16.0.0¶
12 Jun 2021
#200:
TempDircontext now cleans up unconditionally, even if an exception occurs.
v15.1.2¶
21 Feb 2021
#199: Fixed broken link in README.
v15.1.1¶
21 Feb 2021
Refreshed package metadata.
v15.1.0¶
28 Jan 2021
Added
ExtantPathandExtantFileobjects that raise errors when they reference a non-existent path or file.
v15.0.1¶
08 Dec 2020
Refreshed package metadata.
v15.0.0¶
27 Jul 2020
Removed
__version__property. To determine the version, useimportlib.metadata.version('path').
v14.0.1¶
24 May 2020
Fixed regression on Python 3.7 and earlier where
lru_cachedid not support a user function.
v14.0.0¶
24 May 2020
Removed
namebaseproperty. Usesteminstead.Removed
updateparameter on method toPath.merge_tree. Instead, to only copy newer files, provide a wrappedcopyfunction, as described in the doc string.Removed
FastPath. Just usePath.Removed
path.CaseInsensitivePattern. Instead usepath.matchers.CaseInsensitive.Removed
path.tempdir. Usepath.TempDir.#154: Added
Traversalclass and support for customizing the behavior of aPath.walk.
v13.3.0¶
22 May 2020
v13.2.0¶
22 Feb 2020
Require Python 3.6 or later.
v13.1.0¶
01 Dec 2019
#170: Added
read_textandread_bytesmethods to align withpathlibbehavior. Deprecatedtextmethod. If you require newline normalization oftext, usejaraco.text.normalize_newlines(Path.read_text()).
v13.0.0¶
29 Nov 2019
#169: Renamed package from
path.pytopath. The docs make reference to a pet name “path pie” for easier discovery.
v12.5.0¶
27 Jul 2020
#195: Project now depends on
path.
v12.4.0¶
01 Dec 2019
#169: Project now depends on
path < 13.2.Fixed typo in README.
v12.3.0¶
29 Nov 2019
#169: Project is renamed to simply
path. This release ofpath.pysimply depends onpath < 13.1.
v12.2.0¶
29 Nov 2019
#169: Moved project at GitHub from
jaraco/path.pytojaraco/path.
v12.1.0¶
29 Nov 2019
v12.0.2¶
02 Nov 2019
Refreshed package metadata.
12.0.1¶
13 Apr 2019
#166: Removed ‘universal’ wheel support.
12.0 —
12 Apr 2019
#148: Dropped support for Python 2.7 and 3.4.
Moved ‘path’ into a package.
11.5.2¶
09 Apr 2019
#163: Corrected ‘pymodules’ typo in package declaration.
11.5.1¶
08 Apr 2019
Minor packaging refresh.
11.5.0¶
02 Oct 2018
#156: Re-wrote the handling of pattern matches for
listdir,walk, and related methods, allowing the pattern to be a more complex object. This approach drastically simplifies the code and obviates theCaseInsensitivePatternandFastPathclasses. Now the mainPathclass should be as performant asFastPathand case-insensitive matches can be readily constructed using the newpath.matchers.CaseInsensitiveclass.
11.4.1¶
29 Sep 2018
#153: Skip intermittently failing performance test on Python 2.
11.4.0¶
28 Sep 2018
#130: Path.py now supports non-decodable filenames on Linux and Python 2, leveraging the backports.os package (as an optional dependency). Currently, only
listdiris patched, but otherosprimitives may be patched similarly in thepatch_for_linux_python2function.#141: For merge_tree, instead of relying on the deprecated distutils module, implement merge_tree explicitly. The
updateparameter is deprecated, instead superseded by acopy_functionparameter and anonly_newerwrapper for any copy function.
11.3.0¶
18 Sep 2018
#151: No longer use two techniques for splitting lines. Instead, unconditionally rely on io.open for universal newlines support and always use splitlines.
11.2.0¶
15 Sep 2018
#146: Rely on importlib_metadata instead of setuptools/pkg_resources to load the version of the module. Added tests ensuring a <100ms import time for the
pathmodule. This change adds an explicit dependency on the importlib_metadata package, but the project still supports copying of thepath.pymodule without any dependencies.
11.1.0¶
04 Sep 2018
11.0.1¶
26 Mar 2018
#136: Fixed test failures on BSD.
Refreshed package metadata.
11.0¶
11 Feb 2018
Drop support for Python 3.3.
10.6¶
11 Feb 2018
Renamed
namebasetostemto match API of pathlib. Keptnamebaseas a deprecated alias for compatibility.Added new
with_suffixmethod, useful for renaming the extension on a Path:orig = Path('mydir/mypath.bat') renamed = orig.rename(orig.with_suffix('.cmd'))
10.5¶
29 Oct 2017
Packaging refresh and readme updates.
10.4¶
27 Aug 2017
#130: Removed surrogate_escape handler as it’s no longer used.
10.3.1¶
17 Apr 2017
#124: Fixed
rmdir_praisingFileNotFoundErrorwhen directory does not exist on Windows.
10.3¶
16 Apr 2017
#115: Added a new performance-optimized implementation for listdir operations, optimizing
listdir,walk,walkfiles,walkdirs, andfnmatch, presented as theFastPathclass.Please direct feedback on this implementation to the ticket, especially if the performance benefits justify it replacing the default
Pathclass.
10.2¶
16 Apr 2017
Symlink no longer requires the
newlinkparameter and will default to the basename of the target in the current working directory.
10.1¶
23 Jan 2017
10.0¶
02 Jan 2017
Once again as in 8.0 remove deprecated
path.path.
9.1¶
02 Jan 2017
9.0¶
19 Nov 2016
Drop support for Python 2.6 and 3.2 as integration dependencies (pip) no longer support these versions.
8.3¶
19 Nov 2016
Merge with latest skeleton, adding badges and test runs by default under tox instead of pytest-runner.
Documentation is no longer hosted with PyPI.
8.2.1¶
16 Apr 2016
#112: Update Travis CI usage to only deploy on Python 3.5.
8.2¶
08 Apr 2016
Refreshed project metadata based on jaraco’s project skeleton.
Releases are now automatically published via Travis-CI.
#111: More aggressively trap errors when importing
pkg_resources.
8.1.2¶
04 Oct 2015
#105: By using unicode literals, avoid errors rendering the backslash in __get_owner_windows.
8.1.1¶
10 Sep 2015
#102: Reluctantly restored reference to path.path in
__all__.
8.1¶
27 Aug 2015
#102: Restored
path.pathwith a DeprecationWarning.
8.0¶
27 Aug 2015
Removed path.path. Clients must now refer to the canonical
name, path.Path as introduced in 6.2.
7.7¶
23 Aug 2015
#88: Added support for resolving certain directories on a system to platform-friendly locations using the appdirs library. The
Path.specialmethod returns anSpecialResolverinstance that will resolve a path in a scope (i.e. ‘site’ or ‘user’) and class (i.e. ‘config’, ‘cache’, ‘data’). For example, to create a config directory for “My App”:config_dir = Path.special("My App").user.config.makedirs_p()
config_dirwill exist in a user context and will be in a suitable platform-friendly location.As
path.pydoes not currently have any dependencies, and to retain that expectation for a compatible upgrade path,appdirsmust be installed to avoid an ImportError when invokingspecial.#88: In order to support “multipath” results, where multiple paths are returned in a single,
os.pathsep-separated string, a new class MultiPath now represents those special results. This functionality is experimental and may change. Feedback is invited.
7.6.2¶
23 Aug 2015
Re-release of 7.6.1 without unintended feature.
7.6.1¶
19 Aug 2015
#101: Supress error when path.py is not present as a distribution.
7.6¶
09 Aug 2015
#100: Add
merge_treemethod for merging two existing directory trees.Uses setuptools_scm for version management.
7.5¶
02 Aug 2015
#97:
__rdiv__and__rtruediv__are now defined.
7.4¶
12 Jul 2015
7.3¶
14 Apr 2015
#91: Releases now include a universal wheel.
7.2¶
29 Jan 2015
In chmod, added support for multiple symbolic masks (separated by commas).
In chmod, fixed issue in setting of symbolic mask with ‘=’ where unreferenced permissions were cleared.
7.1¶
22 Jan 2015
#23: Added support for symbolic masks to
.chmod.
7.0¶
05 Oct 2014
The
openmethod now usesio.openand supports all of the parameters to that function.openwill always raise anOSErroron failure, even on Python 2.Updated
write_textto support additional newline patterns.The
textmethod now always returns text (never bytes), and thus requires an encoding parameter be supplied if the default encoding is not sufficient to decode the content of the file.
6.2¶
27 Sep 2014
pathclass renamed toPath. Thepathname remains as an alias for compatibility.
6.1¶
27 Sep 2014
chownnow accepts names in addition to numeric IDs.
6.0¶
22 Sep 2014
Drop support for Python 2.5. Python 2.6 or later required.
Installation now requires setuptools.
5.3¶
17 Sep 2014
5.2¶
12 Jun 2014
#61: path.listdir now decodes filenames from os.listdir when loading characters from a file. On Python 3, the behavior is unchanged. On Python 2, the behavior will now mimick that of Python 3, attempting to decode all filenames and paths using the encoding indicated by
sys.getfilesystemencoding(), and escaping any undecodable characters using the ‘surrogateescape’ handler.
5.1¶
30 Jan 2014
#53: Added
path.in_placefor editing files in place.
5.0¶
08 Nov 2013
path.fnmatchnow takes an optional parameternormcaseand this parameter defaults to self.module.normcase (using case normalization most pertinent to the path object itself). Note that this change means that any paths using a custom ntpath module on non-Windows systems will have different fnmatch behavior. Before:# on Unix >>> p = path('Foo') >>> p.module = ntpath >>> p.fnmatch('foo') FalseAfter:
# on any OS >>> p = path('Foo') >>> p.module = ntpath >>> p.fnmatch('foo') TrueTo maintain the original behavior, either don’t define the ‘module’ for the path or supply explicit normcase function:
>>> p.fnmatch('foo', normcase=os.path.normcase) # result always varies based on OS, same as fnmatch.fnmatchFor most use-cases, the default behavior should remain the same.
Issue #50: Methods that accept patterns (
listdir,files,dirs,walk,walkdirs,walkfiles, andfnmatch) will now use anormcaseattribute if it is present on thepatternparameter. The path module now provides aCaseInsensitivePatternwrapper for strings suitable for creating case-insensitive patterns for those methods.
4.4¶
27 Oct 2013
Issue #44: _hash method would open files in text mode, producing invalid results on Windows. Now files are opened in binary mode, producing consistent results.
Issue #47: Documentation is dramatically improved with Intersphinx links to the Python os.path functions and documentation for all methods and properties.
4.3¶
02 Jul 2013
Issue #32: Add
chdirandcdmethods.
4.2¶
02 Jul 2013
open()now passes all positional and keyword arguments through to the underlyingbuiltins.opencall.
4.1¶
28 May 2013
Native Python 2 and Python 3 support without using 2to3 during the build process.
4.0¶
26 May 2013
Added a
chunks()method to a allow quick iteration over pieces of a file at a given path.Issue #28: Fix missing argument to
samefile.Initializer no longer enforces isinstance basestring for the source object. Now any object that supplies
__unicode__can be used by apath(except None). Clients that depend on a ValueError being raised forintand other non-string objects should trap these types internally.Issue #30:
chownno longer requires both uid and gid to be provided and will not mutate the ownership if nothing is provided.
3.2¶
07 May 2013
Issue #22:
__enter__now returns self.
3.1¶
15 Apr 2013
Issue #20: relpath now supports a “start” parameter to match the signature of os.path.relpath.
3.0¶
15 Jan 2013
Minimum Python version is now 2.5.
2.6¶
15 Jan 2013
Issue #5: Implemented path.tempdir, which returns a path object which is a temporary directory and context manager for cleaning up the directory.
Issue #12: One can now construct path objects from a list of strings by simply using path.joinpath. For example:
path.joinpath('a', 'b', 'c') # or path.joinpath(*path_elements)
2.5¶
14 Jan 2013