Repository navigation
v0.8.1
Fixed
LocalPath.walk()/rm()raisedTypeError: cannot unpack non-iterable DirEntry objecton Python 3.11/3.12. Those stdlib versions define their
ownpathlib.Path._scandir()(returning rawos.scandir()DirEntry
objects), which sits ahead of this project's_scandir()inLocalPath's
MRO and silently shadowed it -- breaking the(name, FileStat|None)
contractwalk()/glob()/rm()expect.LocalPathnow defines its own
_scandir()explicitly, reusing eachDirEntry's cachedlstat()so the
perf win from_scandir()unification is preserved. On 3.12+, stdlib
pathlib.Pathalso defines its ownwalk()ahead of ours in the MRO, and
that stdlibwalk()treatsself._scandir()'s return value as a context
manager (with scandir_it:) -- our own_scandir()is a plain generator,
so stdlib'swalk()raisedTypeError: 'generator' object does not support the context manager protocoleven with the override above.
LocalPathnow also overrideswalk()explicitly, routing to this
project's own implementation regardless of Python version. Introduced in
0.8.0 (8cdbefa), exposed on the CI 3.11/3.12 legs.Test No-ExtrasCI job was red.tests/test_smoke.pyunconditionally
constructed anhttp:///sftp://UriPathin two tests, requiring
requests/paramikoeven though the no-extras job installs neither; a
third test wrongly assumedS3Pathrequiresboto3to register (it only
needsbotocore, imported lazily inside a method). The two hard tests now
pytest.importorskiptheir extra; theS3Pathcheck now probes for
botocore. Introduced in 0.8.0 (94bd545/8cdbefa), fixed with the
expected skip count (2) verified in a real no-extras venv.- Importable on a clean Python 3.9 install.
pathlib_next.utilsused
typing.ParamSpec(3.10+), falling back totyping_extensions.ParamSpecand
then to a baretyping.TypeVar. ATypeVarhas no.args, so the
*args: K.argsannotations raisedAttributeError: 'TypeVar' object has no attribute 'args'at import time, makingimport pathlib_nextfail on 3.9
whenevertyping_extensionswas absent. Sincetyping_extensionsis not a
runtime dependency, this broke a plainpip install pathlib_nexton 3.9. The
final fallback is now a minimalParamSpecshim providing.args/.kwargs,
so no runtime dependency is added and 3.10+ keeps usingtyping.ParamSpec
unchanged.
Full Changelog: v0.8.0...v0.8.1