Revert "New encode/decode_path_component functions"

Refs #272

This reverts commit 9fdb47ca95.

Now that ASGI supports raw_path we don't need our own encoding scheme!
This commit is contained in:
Simon Willison 2019-06-18 17:22:26 -07:00
commit 35429f9089
2 changed files with 0 additions and 37 deletions

View file

@ -261,27 +261,6 @@ def escape_sqlite(s):
return "[{}]".format(s)
_decode_path_component_re = re.compile(r"U\+([\da-h]{4})", re.IGNORECASE)
_encode_path_component_re = re.compile(
"[{}]".format(
"".join(
re.escape(c)
for c in (";", "/", "?", ":", "@", "&", "=", "+", "$", ",", "~")
)
)
)
def decode_path_component(table_name):
return _decode_path_component_re.sub(lambda m: chr(int(m.group(1), 16)), table_name)
def encode_path_component(table_name):
return _encode_path_component_re.sub(
lambda m: "U+{0:0{1}x}".format(ord(m.group(0)), 4).upper(), table_name
)
def make_dockerfile(
files,
metadata_file,