Skip to content

v0.9.5

Choose a tag to compare

@github-actions github-actions released this 16 Sep 12:40

Fixed

  • Archive member names are normalized, so the same member is reachable
    however the archive was written and whichever format it is. A leading
    ./ (what tar -C dir ., TarFile.add(arcname=".") and
    shutil.make_archive put on every member), empty segments (a//b) and
    interior ./.. (a/./b, a/b/../c) now resolve to one name for
    listing and lookup alike. Previously only tar: stripped a leading ./:
    a zip written that way listed as empty and none of its members could be
    read under any spelling, while a name such as d//e.txt was readable but
    absent from listings.

Changed

  • A drive- or backslash-shaped member name is no longer dropped.
    C:drive.txt and a\b are ordinary filenames on POSIX, and an archive
    written there may contain them; they were silently absent from every
    listing and unreadable on every platform. The rule they were failing is a
    destination rule, and now lives where the joining happens:
    Path.copy(recursive=True) refuses a child name that would not stay
    inside its target (ValueError through ignore_error), which is what
    PathSyncer and utils.unpack_archive() already did per destination.
    Copying such a member onto a Windows path is still refused; copying it to
    a POSIX path, a MemPath or another archive now works.
  • A member name that escapes the archive root (../x, /abs, a
    .. with nothing left to consume) has no name inside the archive: it was
    already never listed, and is now never readable either. Such a member
    used to be hidden from listings while read_bytes() still returned it
    under its raw name. (Writing to one already failed and created nothing;
    that is unchanged.) A .. that stays inside is resolved rather than
    rejected (pkg/../ok.txt reads ok.txt), and when two spellings
    normalize to one name the later member wins, as in zipfile/tarfile.
  • Uri's RFC 3986 dot-segment removal is documented as a divergence
    from pathlib (docs/divergences.md); the behaviour is unchanged.

Full Changelog: v0.9.4...v0.9.5