Like quote(), but accepts a bytes object rather than a str, and does not perform string-to-bytes encoding.
urllib.parse.quote_from_bytes(bytes, safe='/')