From 10efb729ee9963f42af65259bc61aa8a682cc648 Mon Sep 17 00:00:00 2001 From: "W. Trevor King" Date: Thu, 18 Oct 2012 08:41:09 -0400 Subject: [PATCH] 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: '' --- rss2email.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) 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' -- 2.26.2