Lines Matching refs:safe
765 def __init__(self, safe): argument
767 self.safe = _ALWAYS_SAFE.union(safe)
775 res = chr(b) if b in self.safe else '%{:02X}'.format(b)
779 def quote(string, safe='/', encoding=None, errors=None): argument
824 return quote_from_bytes(string, safe)
826 def quote_plus(string, safe='', encoding=None, errors=None): argument
835 return quote(string, safe, encoding, errors)
836 if isinstance(safe, str):
840 string = quote(string, safe + space, encoding, errors)
843 def quote_from_bytes(bs, safe='/'): argument
852 if isinstance(safe, str):
854 safe = safe.encode('ascii', 'ignore')
856 safe = bytes([c for c in safe if c < 128])
857 if not bs.rstrip(_ALWAYS_SAFE_BYTES + safe):
860 quoter = _safe_quoters[safe]
862 _safe_quoters[safe] = quoter = Quoter(safe).__getitem__
865 def urlencode(query, doseq=False, safe='', encoding=None, errors=None, argument
905 k = quote_via(k, safe)
907 k = quote_via(str(k), safe, encoding, errors)
910 v = quote_via(v, safe)
912 v = quote_via(str(v), safe, encoding, errors)
917 k = quote_via(k, safe)
919 k = quote_via(str(k), safe, encoding, errors)
922 v = quote_via(v, safe)
925 v = quote_via(v, safe, encoding, errors)
933 v = quote_via(str(v), safe, encoding, errors)
939 elt = quote_via(elt, safe)
941 elt = quote_via(str(elt), safe, encoding, errors)