Repository navigation
Make pathlib ABCs usable by zipfile.Path #128520
Copy link
Copy link
Open
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Description
Feature or enhancement
This issue covers the final tasks needed to make the pathlib ABCs worthy of using in zipfile.Path (i.e. zipp.Path).
Tasks
- Rename
PurePathBasetoJoinablePath, and splitPathBaseintoReadablePathandWritablePath - Make
WritablePatha sibling (not subclass) ofReadablePath - Add
ReadablePath.info - Subclass
abc.ABCfromJoinablePath, and makeparserabstract - Make type-checking more consistent
- Move metadata reading into
ReadablePath.info; removeReadablePath._copy_reader - Move metadata writing into
WritablePath._write_info(); removeWritablePath._copy_writer - Merge
pathlib._abcintopathlib.types - Tests: replace the
Dummy*classes with simplezipfile.Path-like implementation - Tests: add tests for
WritablePath - Tests: parametrize
copy()tests - Finalise
copy()implementation - Add type annotations?
- Sync code to pathlib-abc PyPI package
- Update pathlib-abc documentation
- Publish new version of pathlib-abc
- Merge PR to jaraco/zipp
Discussion: https://discuss.python.org/t/make-pathlib-extensible/3428
Linked PRs
- GH-128520: Divide pathlib ABCs into three classes #128523
- GH-128520: Subclass
abc.ABCinpathlib._abc#128745 - GH-128520: Make
pathlib._abc.WritablePatha sibling ofReadablePath#129014 - GH-128520: Read path metadata from
pathlib.types.PathInfowhen copying #129841 - GH-128520: More consistent type-checking behaviour in pathlib #130199
- GH-128520: Merge
pathlib._abcintopathlib.types#130747 - GH-128520: Merge
pathlib._localintopathlib#130748 - GH-128520: pathlib ABCs: fix
with_name()handling of empty names #130964 - GH-128520: pathlib ABCs: allow tests to be run externally #131315
- GH-128520: pathlib ABCs: reject empty pattern in
ReadablePath.glob()#127343 - GH-128520: pathlib ABCs: validate
magic_open()arguments #131617 - GH-128520: pathlib ABCs: tighten up argument types #131621
- GH-128520: pathlib ABCs: raise text encoding warnings at correct stack level #133051
- GH-128520: pathlib ABCs tests: use explicit text encoding #133105
- GH-128520: pathlib ABCs: add
JoinablePath.__vfspath__()#133437 - GH-128520: pathlib ABCs: improve protocol for 'openable' objects #134101
- GH-128520: pathlib ABCs: tweak protocol for virtual path strings #134104
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
stdlibStandard Library Python modules in the Lib/ directoryStandard Library Python modules in the Lib/ directorytopic-pathlibtype-featureA feature request or enhancementA feature request or enhancement
Activity
pythonGH-128520: Divide pathlib ABCs into three classes
pythonGH-128520: Divide pathlib ABCs into three classes
[-]Prepare pathlib ABCs for PEP[/-][+]Make pathlib ABCs usable by zipfile.Path[/+]GH-128520: Divide pathlib ABCs into three classes (#128523)
pythonGH-128520: Subclass `abc.ABC` in `pathlib._abc`
pythonGH-128520: Make `pathlib._abc.WritablePath` a sibling of `Reada…
pythonGH-128520: Make `pathlib._abc.WritablePath` a sibling of `Reada…
Merge branch 'main' into pythongh-128520-fix-inheritance
GH-128520: Make `pathlib._abc.WritablePath` a sibling of `ReadablePat…
23 remaining items
barneygale commentedon Apr 10, 2025
zipp PR is here, so I'm calling this done :)
jaraco/zipp#132
GH-128520: pathlib ABCs: raise text encoding warnings at correct stac…
pythonGH-128520: pathlib ABCs tests: use explicit text encoding
GH-128520: pathlib ABCs tests: use explicit text encoding (#133105)
pythonGH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()`
GH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()` (#133437)
pythonGH-128520: pathlib ABCs: improve protocol for 'openable' objects
pythonGH-128520: pathlib ABCs: tweak protocol for virtual path strings
pythonGH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()` (pyth…
GH-128520: pathlib ABCs: tweak protocol for virtual path strings (#13…
pythonGH-128520: pathlib ABCs: add `JoinablePath.__vfspath__()` (pyth…
pythonGH-128520: pathlib ABCs: tweak protocol for virtual path strings (
GH-128520: pathlib ABCs: improve protocol for 'openable' objects (#13…