Lines Matching refs:safe
787 def __init__(self, safe): argument
789 self.safe = _ALWAYS_SAFE.union(safe)
797 res = chr(b) if b in self.safe else '%{:02X}'.format(b)
801 def quote(string, safe='/', encoding=None, errors=None): argument
853 return quote_from_bytes(string, safe)
855 def quote_plus(string, safe='', encoding=None, errors=None): argument
864 return quote(string, safe, encoding, errors)
865 if isinstance(safe, str):
869 string = quote(string, safe + space, encoding, errors)
872 def quote_from_bytes(bs, safe='/'): argument
881 if isinstance(safe, str):
883 safe = safe.encode('ascii', 'ignore')
885 safe = bytes([c for c in safe if c < 128])
886 if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
889 quoter = _safe_quoters[safe]
891 _safe_quoters[safe] = quoter = Quoter(safe).__getitem__
894 def urlencode(query, doseq=False, safe='', encoding=None, errors=None, argument
934 k = quote_via(k, safe)
936 k = quote_via(str(k), safe, encoding, errors)
939 v = quote_via(v, safe)
941 v = quote_via(str(v), safe, encoding, errors)
946 k = quote_via(k, safe)
948 k = quote_via(str(k), safe, encoding, errors)
951 v = quote_via(v, safe)
954 v = quote_via(v, safe, encoding, errors)
962 v = quote_via(str(v), safe, encoding, errors)
968 elt = quote_via(elt, safe)
970 elt = quote_via(str(elt), safe, encoding, errors)