From 25092cb9dd56ff96c249a193d5af83b874e58d87 Mon Sep 17 00:00:00 2001 From: ioanatomici Date: Tue, 7 Apr 2020 17:53:38 +0200 Subject: [PATCH] no encoding error --- dumpwiki.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/dumpwiki.py b/dumpwiki.py index 16f1635..beabf5f 100644 --- a/dumpwiki.py +++ b/dumpwiki.py @@ -34,7 +34,6 @@ with open('login.txt', 'r') as login: # read login user & pwd SLASH = "\u2044" -HYPHEN = "\u2010" def filenameforpage(p): @@ -45,7 +44,7 @@ def filenameforlink(href): href = urlunquote(href) if href.startswith("/sandbox/itchwiki/index.php/"): href = href[len("/sandbox/itchwiki/index.php/"):] - href = href.replace(' ','_').replace('/', SLASH).replace('‐', HYPHEN) + '.html' + href = href.replace(' ','_').replace('/', SLASH) + '.html' href = urlquote(href) return href @@ -102,7 +101,8 @@ for cat in publish.members(): html = template.render(page=p, body=htmlsrc, staticpath='0') with open(os.path.join(args.output, filenameforpage(p)), 'w') as f: - print(html, file=f) + pass +# print(html, file=f) if args.one: break