From aa98a92edb4bd075af788794554f8d8a1638f7b3 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Thu, 10 Jan 2013 10:17:30 -0800 Subject: [PATCH] encode the title before making a path --- modules/papers.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/modules/papers.py b/modules/papers.py index 64ce8c3..7c88919 100644 --- a/modules/papers.py +++ b/modules/papers.py @@ -91,15 +91,15 @@ def download(phenny, input, verbose=True): data = response.content + # grr.. + title = title.encode("ascii", "ignore") + path = os.path.join("/home/bryan/public_html/papers2/paperbot/", title + ".pdf") file_handler = open(path, "w") file_handler.write(data) file_handler.close() - # grr.. - title = title.encode("ascii", "ignore") - filename = requests.utils.quote(title) url = "http://diyhpl.us/~bryan/papers2/paperbot/" + filename + ".pdf"