Do not pass empty strings to os.makedirs()
authorBernie Innocenti <bernie@codewiz.org>
Sat, 29 Aug 2009 17:51:10 +0000 (19:51 +0200)
committerBernie Innocenti <bernie@codewiz.org>
Sat, 29 Aug 2009 17:51:10 +0000 (19:51 +0200)
geekigeeki.py

index 4ae17b2996fa0da6f7a0b336c7a1df8a69f81e7d..94439abf47df16a3ef21efb7baf2ba7632d35f02 100755 (executable)
@@ -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 = '<strong class="error">' + msg + '</strong>'
             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)