[pp:metadata] fix handling of empty directory paths (#7296)

This commit is contained in:
Mike Fährmann
2025-04-08 15:12:05 +02:00
parent f02dcb720a
commit 8eb365d4b6
3 changed files with 16 additions and 2 deletions

View File

@@ -269,7 +269,7 @@ class PathFormat():
try:
for fmt in self.directory_formatters:
segment = fmt(kwdict).strip()
if strip and segment != "..":
if strip and segment not in {".", ".."}:
# remove trailing dots and spaces (#647)
segment = segment.rstrip(strip)
if segment: