From 20d837a27665632cc5b164b96671290b04c48a58 Mon Sep 17 00:00:00 2001 From: Stephen Finucane Date: Mon, 21 Mar 2022 18:17:41 +0000 Subject: Remove unnecessary unicode prefixes All strings are unicode by default in Python 3. No need to mark them as such. Signed-off-by: Stephen Finucane Change-Id: I68fb60ef271abfddebcc9d2137424f5db2a17e92 --- swiftclient/utils.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) (limited to 'swiftclient') diff --git a/swiftclient/utils.py b/swiftclient/utils.py index e99ed37..860d8bf 100644 --- a/swiftclient/utils.py +++ b/swiftclient/utils.py @@ -172,7 +172,7 @@ def generate_temp_url(path, seconds, key, method, absolute=False, ) hmac_parts.insert(0, "ip=%s" % ip_range) - hmac_body = u'\n'.join(hmac_parts) + hmac_body = '\n'.join(hmac_parts) # Encode to UTF-8 for py3 compatibility if not isinstance(key, bytes): @@ -183,14 +183,14 @@ def generate_temp_url(path, seconds, key, method, absolute=False, expiration = time.strftime( EXPIRES_ISO8601_FORMAT, time.gmtime(expiration)) - temp_url = u'{path}?temp_url_sig={sig}&temp_url_expires={exp}'.format( + temp_url = '{path}?temp_url_sig={sig}&temp_url_expires={exp}'.format( path=path_for_body, sig=sig, exp=expiration) if ip_range: - temp_url += u'&temp_url_ip_range={}'.format(ip_range) + temp_url += '&temp_url_ip_range={}'.format(ip_range) if prefix: - temp_url += u'&temp_url_prefix={}'.format(parts[4]) + temp_url += '&temp_url_prefix={}'.format(parts[4]) # Have return type match path from caller if isinstance(path, bytes): return temp_url.encode('utf-8') -- cgit v1.2.1