Skip to content

Commit

Permalink
Add decoding of incoming URLs, fixes ckan#46
Browse files Browse the repository at this point in the history
  • Loading branch information
KrzysztofMadejski committed Jun 6, 2017
1 parent 37407f1 commit c656408
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion ckanext/archiver/tasks.py
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,6 @@
import re
import routes
import time
import urlparse

from requests.packages import urllib3

Expand Down Expand Up @@ -555,6 +554,7 @@ def archive_resource(context, resource, log, result=None, url_timeout=30):
parsed_url = urlparse.urlparse(resource.get('url'))
try:
file_name = parsed_url.path.split('/')[-1] or 'resource'
file_name = urllib.unquote(file_name)
file_name = file_name.strip() # trailing spaces cause problems
file_name = file_name.encode('ascii', 'ignore') # e.g. u'\xa3' signs
except:
Expand Down

0 comments on commit c656408

Please sign in to comment.