diff options
author | Zuul <zuul@review.opendev.org> | 2022-08-18 01:49:01 +0000 |
---|---|---|
committer | Gerrit Code Review <review@openstack.org> | 2022-08-18 01:49:01 +0000 |
commit | 7f2649bfb717f0f1cc077c04e206841581d6dab5 (patch) | |
tree | 5a3af5deb92fdf9ea11f314660dc4bd5ab03107e /swiftclient | |
parent | 9eee29d2e46e774eb08acb76c3317a58856f3f71 (diff) | |
parent | 5d451fb92031989ea9982fc29140175014448ea2 (diff) | |
download | python-swiftclient-7f2649bfb717f0f1cc077c04e206841581d6dab5.tar.gz |
Merge "More cleanup following py2 removal"
Diffstat (limited to 'swiftclient')
-rw-r--r-- | swiftclient/client.py | 10 | ||||
-rw-r--r-- | swiftclient/service.py | 5 | ||||
-rwxr-xr-x | swiftclient/shell.py | 2 |
3 files changed, 1 insertions, 16 deletions
diff --git a/swiftclient/client.py b/swiftclient/client.py index a9130ab..168bfed 100644 --- a/swiftclient/client.py +++ b/swiftclient/client.py @@ -23,7 +23,7 @@ import warnings from requests.exceptions import RequestException, SSLError import http.client as http_client -from urllib.parse import quote as _quote, unquote +from urllib.parse import quote, unquote from urllib.parse import urljoin, urlparse, urlunparse from time import sleep, time @@ -181,14 +181,6 @@ def parse_header_string(data): return unquoted -def quote(value, safe='/'): - """ - Patched version of urllib.quote that encodes utf8 strings before quoting. - On Python 3, call directly urllib.parse.quote(). - """ - return _quote(value, safe=safe) - - def encode_utf8(value): if type(value) in (int, float, bool): # As of requests 2.11.0, headers must be byte- or unicode-strings. diff --git a/swiftclient/service.py b/swiftclient/service.py index 9d9fc59..ed0f40a 100644 --- a/swiftclient/service.py +++ b/swiftclient/service.py @@ -2034,11 +2034,6 @@ class SwiftService: if headers is None: headers = {} segment_results.sort(key=lambda di: di['segment_index']) - for seg in segment_results: - seg_loc = seg['segment_location'].lstrip('/') - if isinstance(seg_loc, str): - seg_loc = seg_loc.encode('utf-8') - manifest_data = json.dumps([ { 'path': d['segment_location'], diff --git a/swiftclient/shell.py b/swiftclient/shell.py index b4721fe..5bcff7f 100755 --- a/swiftclient/shell.py +++ b/swiftclient/shell.py @@ -1938,8 +1938,6 @@ def add_default_args(parser): def main(arguments=None): argv = sys_argv if arguments is None else arguments - argv = [a if isinstance(a, str) else a.decode('utf-8') for a in argv] - parser = argparse.ArgumentParser( add_help=False, formatter_class=HelpFormatter, usage=''' %(prog)s [--version] [--help] [--os-help] [--snet] [--verbose] |