Skip to content

Commit 19397c0

Browse files
committed
Strip possibly present trailing / before adding one
Without that users must have trailing / removed, but nobody checks for that etc. So now we have "raw//" etc, e.g. at https://bids-specification.readthedocs.io/en/latest/derivatives/common-data-types.html#example-use-of-a-descriptionstsv-file With this change it would make it easier on user and guaranteed to render consistently correctly
1 parent 183499c commit 19397c0

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

tools/examplecode/example.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -69,7 +69,7 @@ def _add_dictionary(
6969

7070
# We are dealing with a directory
7171
else:
72-
self._tree.append(f"{prefix}{connector} {entry}{os.sep}")
72+
self._tree.append(f"{prefix}{connector} {entry.rstrip(os.sep)}{os.sep}")
7373
prefix += (
7474
self.PIPE_PREFIX if index != entries_count - 1 else self.SPACE_PREFIX
7575
)

0 commit comments

Comments
 (0)