From: W. Trevor King Date: Thu, 18 Oct 2012 12:41:09 +0000 (-0400) Subject: rss2email: don't create directories for files in the current directory. X-Git-Tag: v3.0~72^2~20 X-Git-Url: http://git.tremily.us/?a=commitdiff_plain;h=10efb729ee9963f42af65259bc61aa8a682cc648;p=rss2email.git rss2email: don't create directories for files in the current directory. This avoids: $ ./rss2email.py -d feeds.dat new ... OSError: [Errno 2] No such file or directory: '' --- diff --git a/rss2email.py b/rss2email.py index 7a94c5f..e994bb4 100755 --- a/rss2email.py +++ b/rss2email.py @@ -1350,7 +1350,7 @@ class Feeds (list): for feed in self: feed.save_to_config() dirname = _os.path.dirname(self.configfiles[-1]) - if not _os.path.isdir(dirname): + if dirname and not _os.path.isdir(dirname): _os.makedirs(dirname) with open(self.configfiles[-1], 'w') as f: self.config.write(f) @@ -1359,7 +1359,7 @@ class Feeds (list): def _save_feeds(self): LOG.debug('save feed data to {}'.format(self.datafile)) dirname = _os.path.dirname(self.datafile) - if not _os.path.isdir(dirname): + if dirname and not _os.path.isdir(dirname): _os.makedirs(dirname) if UNIX: tmpfile = self.datafile + '.tmp'