Skip to content

Commit

Permalink
don't overwrite self.path after it was already normalized
Browse files Browse the repository at this point in the history
fixes issue #166
  • Loading branch information
Felix Kloft committed Apr 17, 2023
1 parent fc1456b commit 569e264
Showing 1 changed file with 2 additions and 6 deletions.
8 changes: 2 additions & 6 deletions bagit.py
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,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 = {}
Expand All @@ -302,11 +302,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
Expand Down

0 comments on commit 569e264

Please sign in to comment.