Version bump to v1.11.2rc0

Small refactoring
This commit is contained in:
allegroai 2023-07-10 11:20:27 +03:00
parent 3f882c37b9
commit 5aa80267d6
3 changed files with 6 additions and 6 deletions

View File

@ -2414,7 +2414,7 @@ class StorageHelper(object):
if self.scheme in StorageHelper._quotable_uri_schemes: # TODO: fix-driver-schema if self.scheme in StorageHelper._quotable_uri_schemes: # TODO: fix-driver-schema
# quote link # quote link
result_dest_path = quote_url(result_dest_path) result_dest_path = quote_url(result_dest_path, StorageHelper._quotable_uri_schemes)
return result_dest_path return result_dest_path
@ -2436,7 +2436,7 @@ class StorageHelper(object):
# quote link # quote link
def callback(result): def callback(result):
return a_cb(quote_url(result_path) if result else result) return a_cb(quote_url(result_path, StorageHelper._quotable_uri_schemes) if result else result)
# replace callback with wrapper # replace callback with wrapper
cb = callback cb = callback
@ -2463,7 +2463,7 @@ class StorageHelper(object):
retries=retries, retries=retries,
return_canonized=return_canonized) return_canonized=return_canonized)
if res: if res:
result_path = quote_url(result_path) result_path = quote_url(result_path, StorageHelper._quotable_uri_schemes)
return result_path return result_path
def list(self, prefix=None, with_metadata=False): def list(self, prefix=None, with_metadata=False):

View File

@ -42,9 +42,9 @@ def get_config_object_matcher(**patterns):
return _matcher return _matcher
def quote_url(url): def quote_url(url, valid_schemes=("http", "https")):
parsed = urlparse(url) parsed = urlparse(url)
if parsed.scheme not in ("http", "https"): if parsed.scheme not in valid_schemes:
return url return url
parsed = parsed._replace(path=quote(parsed.path)) parsed = parsed._replace(path=quote(parsed.path))
return urlunparse(parsed) return urlunparse(parsed)

View File

@ -1 +1 @@
__version__ = '1.11.1' __version__ = '1.11.2rc0'