From 41a64735175f68c54569c9a106766dd8037290e0 Mon Sep 17 00:00:00 2001 From: Bernie Innocenti Date: Mon, 27 Jul 2009 17:43:11 +0200 Subject: [PATCH] Fix directory creation --- geekigeeki.py | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) 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): -- 2.25.1