mirror of
https://github.com/SickGear/SickGear.git
synced 2024-11-28 23:53:37 +00:00
Merge branch 'feature/UpdateTornado' into dev
This commit is contained in:
commit
8b8aa3f376
3 changed files with 13 additions and 30 deletions
|
@ -2,6 +2,7 @@
|
|||
|
||||
* Update filelock 3.14.0 (8556141) to 3.15.4 (9a979df)
|
||||
* Update package resource API 68.2.2 (8ad627d) to 70.1.1 (222ebf9)
|
||||
* Update Tornado Web Server 6.4.1 (2a0e1d1) to 6.4.2 (27b3252)
|
||||
* Update urllib3 2.2.1 (54d6edf) to 2.2.2 (27e2a5c)
|
||||
* Change add TheTVDb v4 support
|
||||
* Add menu Shows/"TVDb Cards"
|
||||
|
|
|
@ -22,8 +22,8 @@
|
|||
# is zero for an official release, positive for a development branch,
|
||||
# or negative for a release candidate or beta (after the base version
|
||||
# number has been incremented)
|
||||
version = "6.4.1"
|
||||
version_info = (6, 4, 0, 1)
|
||||
version = "6.4.2"
|
||||
version_info = (6, 4, 2, 0)
|
||||
|
||||
import importlib
|
||||
import typing
|
||||
|
|
|
@ -1057,15 +1057,20 @@ def qs_to_qsl(qs: Dict[str, List[AnyStr]]) -> Iterable[Tuple[str, AnyStr]]:
|
|||
yield (k, v)
|
||||
|
||||
|
||||
_OctalPatt = re.compile(r"\\[0-3][0-7][0-7]")
|
||||
_QuotePatt = re.compile(r"[\\].")
|
||||
_nulljoin = "".join
|
||||
_unquote_sub = re.compile(r"\\(?:([0-3][0-7][0-7])|(.))").sub
|
||||
|
||||
|
||||
def _unquote_replace(m: re.Match) -> str:
|
||||
if m[1]:
|
||||
return chr(int(m[1], 8))
|
||||
else:
|
||||
return m[2]
|
||||
|
||||
|
||||
def _unquote_cookie(s: str) -> str:
|
||||
"""Handle double quotes and escaping in cookie values.
|
||||
|
||||
This method is copied verbatim from the Python 3.5 standard
|
||||
This method is copied verbatim from the Python 3.13 standard
|
||||
library (http.cookies._unquote) so we don't have to depend on
|
||||
non-public interfaces.
|
||||
"""
|
||||
|
@ -1086,30 +1091,7 @@ def _unquote_cookie(s: str) -> str:
|
|||
# \012 --> \n
|
||||
# \" --> "
|
||||
#
|
||||
i = 0
|
||||
n = len(s)
|
||||
res = []
|
||||
while 0 <= i < n:
|
||||
o_match = _OctalPatt.search(s, i)
|
||||
q_match = _QuotePatt.search(s, i)
|
||||
if not o_match and not q_match: # Neither matched
|
||||
res.append(s[i:])
|
||||
break
|
||||
# else:
|
||||
j = k = -1
|
||||
if o_match:
|
||||
j = o_match.start(0)
|
||||
if q_match:
|
||||
k = q_match.start(0)
|
||||
if q_match and (not o_match or k < j): # QuotePatt matched
|
||||
res.append(s[i:k])
|
||||
res.append(s[k + 1])
|
||||
i = k + 2
|
||||
else: # OctalPatt matched
|
||||
res.append(s[i:j])
|
||||
res.append(chr(int(s[j + 1 : j + 4], 8)))
|
||||
i = j + 4
|
||||
return _nulljoin(res)
|
||||
return _unquote_sub(_unquote_replace, s)
|
||||
|
||||
|
||||
def parse_cookie(cookie: str) -> Dict[str, str]:
|
||||
|
|
Loading…
Reference in a new issue