This commit is contained in:
2025-05-22 21:22:15 +02:00
parent 3d57f842f9
commit 97cb9c8703
156 changed files with 1205 additions and 6603 deletions

View File

@@ -3,7 +3,6 @@ from __future__ import annotations
import re
import typing as t
import uuid
import warnings
from urllib.parse import quote
if t.TYPE_CHECKING:
@@ -42,17 +41,8 @@ class BaseConverter:
return value
def to_url(self, value: t.Any) -> str:
if isinstance(value, (bytes, bytearray)):
warnings.warn(
"Passing bytes as a URL value is deprecated and will not be supported"
" in Werkzeug 3.0.",
DeprecationWarning,
stacklevel=7,
)
return quote(value, safe="!$&'()*+,/:;=@")
# safe = https://url.spec.whatwg.org/#url-path-segment-string
return quote(str(value), encoding=self.map.charset, safe="!$&'()*+,/:;=@")
return quote(str(value), safe="!$&'()*+,/:;=@")
class UnicodeConverter(BaseConverter):
@@ -129,6 +119,7 @@ class PathConverter(BaseConverter):
:param map: the :class:`Map`.
"""
part_isolating = False
regex = "[^/].*?"
weight = 200