From 9c4137b12a124122a44c905ab82272f48d128d63 Mon Sep 17 00:00:00 2001 From: Ian Weller Date: Mon, 7 Dec 2009 02:00:26 -0500 Subject: [PATCH] Handle slashes in page names semi-appropriately --- src/mw/clicommands.py | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/src/mw/clicommands.py b/src/mw/clicommands.py index 3657d53..7726703 100644 --- a/src/mw/clicommands.py +++ b/src/mw/clicommands.py @@ -97,7 +97,8 @@ class FetchCommand(CommandBase): response[pageid]['title'], revid) self.metadir.add_rv_info(response[pageid]['revisions'][0]) - fd = file(os.path.join(self.metadir.root, \ - response[pageid]['title'].replace(' ', '_') + \ - '.wiki'), 'w') + filename = response[pageid]['title'].replace(' ', '_') + filename = filename.replace('/', '!') + fd = file(os.path.join(self.metadir.root, filename + '.wiki'), + 'w') fd.write(response[pageid]['revisions'][0]['*'].encode('utf-8')) -- 2.39.5