From c2d4abde97819a3bda82c3f7f78da53a5c2c06ab Mon Sep 17 00:00:00 2001 From: Felix Kloft Date: Mon, 17 Apr 2023 14:01:24 +0200 Subject: [PATCH] don't overwrite self.path after it was already normalized fixes issue #166 --- bagit.py | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-) diff --git a/bagit.py b/bagit.py index 178fe9c..0a5c0f3 100755 --- a/bagit.py +++ b/bagit.py @@ -277,7 +277,7 @@ class Bag(object): valid_files = ["bagit.txt", "fetch.txt"] valid_directories = ["data"] - def __init__(self, path=None): + def __init__(self, path): super(Bag, self).__init__() self.tags = {} self.info = {} @@ -300,11 +300,7 @@ def __init__(self, path=None): self.algorithms = [] self.tag_file_name = None self.path = os.path.abspath(path) - if path: - # if path ends in a path separator, strip it off - if path[-1] == os.sep: - self.path = path[:-1] - self._open() + self._open() def __str__(self): # FIXME: develop a more informative string representation for a Bag