From c73b6f00c16f526015a903642618806a4c642d72 Mon Sep 17 00:00:00 2001 From: Ross Jones Date: Thu, 16 Aug 2012 15:19:50 +0100 Subject: [PATCH] 2867 Fixes a problem with passing unicode to url_for Forces the file_url to be ascii as it appears that for some reason, and only occassionally OFS returns unicode instead of str. We don't want to fix OFS as it is scheduled for removal and we can fix routes as it is already out of date. --- ckan/controllers/storage.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/ckan/controllers/storage.py b/ckan/controllers/storage.py index 19dd64554a1..1ebde2b9d40 100644 --- a/ckan/controllers/storage.py +++ b/ckan/controllers/storage.py @@ -187,7 +187,7 @@ def file(self, label): fapp = FileApp(filepath, headers=None, **headers) return fapp(request.environ, self.start_response) else: - h.redirect_to(file_url) + h.redirect_to(file_url.encode('ascii','ignore')) class StorageAPIController(BaseController):