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 authored and acdha committed Oct 15, 2024
1 parent 1f89422 commit c2d4abd
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 @@ -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 = {}
Expand All @@ -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
Expand Down

0 comments on commit c2d4abd

Please sign in to comment.