From f543a0f989cbe13e2e80e1870e3d0a318ac84e24 Mon Sep 17 00:00:00 2001 From: Thorge Petersen Date: Mon, 4 Sep 2023 12:40:25 +0200 Subject: [PATCH] No need to decode a string to ASCII explicitly because py3 strings are unicode by default --- ckanext/archiver/tasks.py | 10 ---------- 1 file changed, 10 deletions(-) diff --git a/ckanext/archiver/tasks.py b/ckanext/archiver/tasks.py index 06a1758c..ca74ec26 100644 --- a/ckanext/archiver/tasks.py +++ b/ckanext/archiver/tasks.py @@ -650,16 +650,6 @@ def tidy_url(url): It may raise LinkInvalidError if the URL has a problem. ''' - # Find out if it has unicode characters, and if it does, quote them - # so we are left with an ascii string - try: - url = url.decode('ascii') - except Exception: - parts = list(urlparse(url)) - parts[2] = quote(parts[2].encode('utf-8')) - url = urlunparse(parts) - url = str(url) - # strip whitespace from url # (browsers appear to do this) url = url.strip()