Because
>>> import os.path
>>> os.path.dirname('some-file')
''
>>> os.path.dirname('some-file') or '.'
'.'
and
>>> import os
>>> os.makedirs('')
Traceback (most recent call last):
...
OSError: [Errno 2] No such file or directory: ''
"""Saves the command stack to `path`.
"""
self.set_path(path)
- dirname = os.path.dirname(self.path)
+ dirname = os.path.dirname(self.path) or '.'
if makedirs == True and not os.path.isdir(dirname):
os.makedirs(dirname)
with open(self.path, 'w') as f:
"""Saves the playlist in a XML file.
"""
self.set_path(path)
- dirname = os.path.dirname(self.path)
+ dirname = os.path.dirname(self.path) or '.'
if makedirs == True and not os.path.isdir(dirname):
os.makedirs(dirname)
with open(self.path, 'w') as f: