Skip to content

Commit c2d4abd

Browse files
Felix Kloftacdha
authored andcommitted
don't overwrite self.path after it was already normalized
fixes issue #166
1 parent 1f89422 commit c2d4abd

File tree

1 file changed

+2
-6
lines changed

1 file changed

+2
-6
lines changed

bagit.py

Lines changed: 2 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -277,7 +277,7 @@ class Bag(object):
277277
valid_files = ["bagit.txt", "fetch.txt"]
278278
valid_directories = ["data"]
279279

280-
def __init__(self, path=None):
280+
def __init__(self, path):
281281
super(Bag, self).__init__()
282282
self.tags = {}
283283
self.info = {}
@@ -300,11 +300,7 @@ def __init__(self, path=None):
300300
self.algorithms = []
301301
self.tag_file_name = None
302302
self.path = os.path.abspath(path)
303-
if path:
304-
# if path ends in a path separator, strip it off
305-
if path[-1] == os.sep:
306-
self.path = path[:-1]
307-
self._open()
303+
self._open()
308304

309305
def __str__(self):
310306
# FIXME: develop a more informative string representation for a Bag

0 commit comments

Comments
 (0)