Skip to content

Commit 7b93a90

Browse files
committed
Add comment explaining _GlobberTargetPath
1 parent b860576 commit 7b93a90

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

dissect/target/helpers/compat/path_313.py

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -115,7 +115,7 @@ def __init__(self, fs: Filesystem, *pathsegments):
115115
def with_segments(self, *pathsegments) -> TargetPath:
116116
return type(self)(self._fs, *pathsegments)
117117

118-
# NOTE: This is copied from pathlib.py but turned into an instance method so we get access to the correct flavour
118+
# NOTE: This is copied from pathlib/_local.py but turned into an instance method so we get access to the correct flavour
119119
def _parse_path(self, path: str) -> tuple[str, str, list[str]]:
120120
if not path:
121121
return "", "", []
@@ -393,4 +393,7 @@ def group(self) -> str:
393393

394394
class _GlobberTargetPath(TargetPath):
395395
def __str__(self) -> str:
396+
# This is necessary because the _Globber class expects an added `/` at the end
397+
# However, only PurePathBase properly adds that, PurePath doesn't
398+
# We do want to operate on Path objects rather than strings, so do a little hack here
396399
return self._raw_path

0 commit comments

Comments
 (0)