From cb0b7cf60e3e3c9f5854686d7725960ff77b7301 Mon Sep 17 00:00:00 2001 From: Konstantinos Tselepakis Date: Fri, 9 Feb 2024 23:44:31 +0200 Subject: [PATCH] Cleanup unused regex patterns (#82) --- multipart/multipart.py | 11 ----------- 1 file changed, 11 deletions(-) diff --git a/multipart/multipart.py b/multipart/multipart.py index e1d10fc..6ec1364 100644 --- a/multipart/multipart.py +++ b/multipart/multipart.py @@ -2,7 +2,6 @@ from .exceptions import * import os -import re import sys import shutil import logging @@ -67,16 +66,6 @@ ord_char = lambda c: c join_bytes = lambda b: bytes(list(b)) -# These are regexes for parsing header values. -SPECIAL_CHARS = re.escape(b'()<>@,;:\\"/[]?={} \t') -QUOTED_STR = br'"(?:\\.|[^"])*"' -VALUE_STR = br'(?:[^' + SPECIAL_CHARS + br']+|' + QUOTED_STR + br')' -OPTION_RE_STR = ( - br'(?:;|^)\s*([^' + SPECIAL_CHARS + br']+)\s*=\s*(' + VALUE_STR + br')' -) -OPTION_RE = re.compile(OPTION_RE_STR) -QUOTE = b'"'[0] - def parse_options_header(value: Union[str, bytes]) -> Tuple[bytes, Dict[bytes, bytes]]: """