From 751cb9fe638e0b98bb80904892d72e605d6a5bc7 Mon Sep 17 00:00:00 2001 From: Bryan Bishop Date: Wed, 16 Jan 2013 02:43:20 -0600 Subject: [PATCH] don't encode the title until later --- modules/papers.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/modules/papers.py b/modules/papers.py index 91feeed..0e66b2d 100644 --- a/modules/papers.py +++ b/modules/papers.py @@ -158,9 +158,9 @@ def download_url(url): # extract some metadata with xpaths citation_pdf_url = find_citation_pdf_url(tree, url) citation_title = find_citation_title(tree) - citation_title = citation_title.encode("ascii", "ignore") if citation_pdf_url and citation_title: + citation_title = citation_title.encode("ascii", "ignore") response = requests.get(citation_pdf_url, headers={"User-Agent": "pdf-defense-force"}) content = response.content if "pdf" in response.headers["content-type"]: