From: Bernie Innocenti Date: Sat, 29 Aug 2009 17:51:10 +0000 (+0200) Subject: Do not pass empty strings to os.makedirs() X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=d248569ef8cbae2c13106dc1b52aa9c80ab355e9;p=geekigeeki.git Do not pass empty strings to os.makedirs() --- diff --git a/geekigeeki.py b/geekigeeki.py index 4ae17b2..94439ab 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -418,7 +418,7 @@ class WikiFormatter: macro = globals().get('_macro_' + args[0]) return macro(*args, **kvargs) except Exception, e: - msg = cgi.escape(word) + ": " + cgi.escape(e.message) + msg = cgi.escape(word) + ": " + cgi.escape(str(e)) if not self.in_html: msg = '' + msg + '' return msg @@ -784,7 +784,7 @@ class Page: except OSError, err: if err.errno != errno.ENOENT: raise err path = os.path.split(name)[0] - if not os.path.exists(path): + if path and not os.path.exists(path): os.makedirs(path) os.rename(tmp_filename, name)