def encode_path(*components): 'Encode the path specified as a list of path components using URL encoding' return '/' + '/'.join(urlquote(x.encode('utf-8'), '') for x in components)
def quoted(x): if not isinstance(x, (str, bytes)): x = str(x) if isinstance(x, str): x = x.encode('utf-8') return urlquote(x, '')
def quoted(x): if not isinstance(x, (unicode_type, bytes)): x = unicode_type(x) if isinstance(x, unicode_type): x = x.encode('utf-8') return urlquote(x, '')