-
Notifications
You must be signed in to change notification settings - Fork 20
Description
Python 3.12 added support for pathlib.Path.match to accept a path-like object instead of just a string. Python 3.14 subtly adjusted the behaviour to also work for any object that implements with_segments, even if it isn't path-like.
Python 3.13 added the related method pathlib.Path.full_match.
We should investigate which (if any) of these changes charmlibs.pathops could (and should) support now, and clearly document when we should add support for other features.
The match behaviour change on Python 3.14 prompted the creation of this issue, as a ContainerPath will now be accepted at runtime by pathlib.PurePath.match, LocalPath.match, and ContainerPath.match. At the very least, ContainerPath.match should probably return False if the containers don't match, if not make it an error to use ContainerPath here since it isn't os.PathLike.