MCPcopy Create free account
hub / github.com/s3tools/s3cmd / base_urlencode_string

Function base_urlencode_string

S3/BaseUtils.py:197–209  ·  view source on GitHub ↗
(string, urlencoding_mode = None, unicode_output=False)

Source from the content-addressed store, hash-verified

195
196
197def base_urlencode_string(string, urlencoding_mode = None, unicode_output=False):
198 string = encode_to_s3(string)
199
200 if urlencoding_mode == "verbatim":
201 ## Don't do any pre-processing
202 return string
203
204 encoded = quote(string, safe="~/")
205 debug("String '%s' encoded to '%s'" % (string, encoded))
206 if unicode_output:
207 return decode_from_s3(encoded)
208 else:
209 return encode_to_s3(encoded)
210__all__.append("base_urlencode_string")
211
212

Callers 1

urlencode_stringFunction · 0.90

Calls 2

encode_to_s3Function · 0.85
decode_from_s3Function · 0.85

Tested by

no test coverage detected

Used in the wild real call sites across dependent graphs

searching dependent graphs…