From: Bernie Innocenti Date: Mon, 27 Jul 2009 15:43:11 +0000 (+0200) Subject: Fix directory creation X-Git-Url: https://codewiz.org/gitweb?a=commitdiff_plain;h=41a64735175f68c54569c9a106766dd8037290e0;p=geekigeeki.git Fix directory creation --- diff --git a/geekigeeki.py b/geekigeeki.py index d3ce220..2fb9030 100755 --- a/geekigeeki.py +++ b/geekigeeki.py @@ -795,7 +795,9 @@ class Page: os.remove(name) except OSError, err: if err.errno != errno.ENOENT: raise err - os.makedirs(os.path.split(name)[0]) + path = os.path.split(name)[0] + if not os.path.exists(path): + os.makedirs(path) os.rename(tmp_filename, name) def save(self, newdata, changelog):