Skip to content

v0.8.1

Choose a tag to compare

@github-actions github-actions released this 16 Jul 15:00
· 461 commits to main since this release

Fixed

  • LocalPath.walk()/rm() raised TypeError: cannot unpack non-iterable DirEntry object on Python 3.11/3.12. Those stdlib versions define their
    own pathlib.Path._scandir() (returning raw os.scandir() DirEntry
    objects), which sits ahead of this project's _scandir() in LocalPath's
    MRO and silently shadowed it -- breaking the (name, FileStat|None)
    contract walk()/glob()/rm() expect. LocalPath now defines its own
    _scandir() explicitly, reusing each DirEntry's cached lstat() so the
    perf win from _scandir() unification is preserved. On 3.12+, stdlib
    pathlib.Path also defines its own walk() ahead of ours in the MRO, and
    that stdlib walk() treats self._scandir()'s return value as a context
    manager (with scandir_it:) -- our own _scandir() is a plain generator,
    so stdlib's walk() raised TypeError: 'generator' object does not support the context manager protocol even with the override above.
    LocalPath now also overrides walk() 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-Extras CI job was red. tests/test_smoke.py unconditionally
    constructed an http:///sftp:// UriPath in two tests, requiring
    requests/paramiko even though the no-extras job installs neither; a
    third test wrongly assumed S3Path requires boto3 to register (it only
    needs botocore, imported lazily inside a method). The two hard tests now
    pytest.importorskip their extra; the S3Path check 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.utils used
    typing.ParamSpec (3.10+), falling back to typing_extensions.ParamSpec and
    then to a bare typing.TypeVar. A TypeVar has no .args, so the
    *args: K.args annotations raised AttributeError: 'TypeVar' object has no attribute 'args' at import time, making import pathlib_next fail on 3.9
    whenever typing_extensions was absent. Since typing_extensions is not a
    runtime dependency, this broke a plain pip install pathlib_next on 3.9. The
    final fallback is now a minimal ParamSpec shim providing .args/.kwargs,
    so no runtime dependency is added and 3.10+ keeps using typing.ParamSpec
    unchanged.

Full Changelog: v0.8.0...v0.8.1