Skip to content

Commit

Permalink
Strip possibly present trailing / before adding one
Browse files Browse the repository at this point in the history
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
  • Loading branch information
yarikoptic committed Sep 3, 2024
1 parent 183499c commit 19397c0
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion tools/examplecode/example.py
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,7 @@ def _add_dictionary(

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

0 comments on commit 19397c0

Please sign in to comment.