Script 'mail_helper' called by obssrc
Hello community,
here is the log from the commit of package python-Werkzeug for openSUSE:Factory
checked in at 2022-02-17 00:29:56
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Comparing /work/SRC/openSUSE:Factory/python-Werkzeug (Old)
and /work/SRC/openSUSE:Factory/.python-Werkzeug.new.1956 (New)
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-Werkzeug"
Thu Feb 17 00:29:56 2022 rev:34 rq:954652 version:2.0.3
Changes:
--------
--- /work/SRC/openSUSE:Factory/python-Werkzeug/python-Werkzeug.changes
2021-10-20 20:24:19.773379751 +0200
+++
/work/SRC/openSUSE:Factory/.python-Werkzeug.new.1956/python-Werkzeug.changes
2022-02-17 00:30:04.277438049 +0100
@@ -1,0 +2,15 @@
+Tue Feb 15 08:39:23 UTC 2022 - Dirk M??ller <[email protected]>
+
+- update to 2.0.3:
+ * ``ProxyFix`` supports IPv6 addresses.
+ * Type annotation for ``Response.make_conditional``,
+ ``HTTPException.get_response``, and ``Map.bind_to_environ`` accepts
+ ``Request`` in addition to ``WSGIEnvironment`` for the first
+ parameter.
+ * Fix type annotation for ``Request.user_agent_class``.
+ * Accessing ``LocalProxy.__class__`` and ``__doc__`` on an unbound
+ proxy returns the fallback value instead of a method object.
+ * Redirects with the test client set ``RAW_URI`` and ``REQUEST_URI``
+ correctly.
+
+-------------------------------------------------------------------
Old:
----
Werkzeug-2.0.2.tar.gz
New:
----
Werkzeug-2.0.3.tar.gz
++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Other differences:
------------------
++++++ python-Werkzeug.spec ++++++
--- /var/tmp/diff_new_pack.MMwqBw/_old 2022-02-17 00:30:04.917437939 +0100
+++ /var/tmp/diff_new_pack.MMwqBw/_new 2022-02-17 00:30:04.933437936 +0100
@@ -1,7 +1,7 @@
#
# spec file for package python-Werkzeug
#
-# Copyright (c) 2021 SUSE LLC
+# Copyright (c) 2022 SUSE LLC
#
# All modifications and additions to the file contributed by third parties
# remain the property of their copyright owners, unless otherwise agreed
@@ -19,7 +19,7 @@
%{?!python_module:%define python_module() python-%{**} python3-%{**}}
%define skip_python2 1
Name: python-Werkzeug
-Version: 2.0.2
+Version: 2.0.3
Release: 0
Summary: The Swiss Army knife of Python web development
License: BSD-3-Clause
++++++ Werkzeug-2.0.2.tar.gz -> Werkzeug-2.0.3.tar.gz ++++++
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/CHANGES.rst
new/Werkzeug-2.0.3/CHANGES.rst
--- old/Werkzeug-2.0.2/CHANGES.rst 2021-10-06 02:26:02.000000000 +0200
+++ new/Werkzeug-2.0.3/CHANGES.rst 2022-02-07 22:02:15.000000000 +0100
@@ -1,5 +1,23 @@
.. currentmodule:: werkzeug
+Version 2.0.3
+-------------
+
+Released 2022-02-07
+
+- ``ProxyFix`` supports IPv6 addresses. :issue:`2262`
+- Type annotation for ``Response.make_conditional``,
+ ``HTTPException.get_response``, and ``Map.bind_to_environ`` accepts
+ ``Request`` in addition to ``WSGIEnvironment`` for the first
+ parameter. :pr:`2290`
+- Fix type annotation for ``Request.user_agent_class``. :issue:`2273`
+- Accessing ``LocalProxy.__class__`` and ``__doc__`` on an unbound
+ proxy returns the fallback value instead of a method object.
+ :issue:`2188`
+- Redirects with the test client set ``RAW_URI`` and ``REQUEST_URI``
+ correctly. :issue:`2151`
+
+
Version 2.0.2
-------------
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/PKG-INFO new/Werkzeug-2.0.3/PKG-INFO
--- old/Werkzeug-2.0.2/PKG-INFO 2021-10-06 02:26:29.742697200 +0200
+++ new/Werkzeug-2.0.3/PKG-INFO 2022-02-07 22:02:50.243791800 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Werkzeug
-Version: 2.0.2
+Version: 2.0.3
Summary: The comprehensive WSGI web application library.
Home-page: https://palletsprojects.com/p/werkzeug/
Author: Armin Ronacher
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/docs/tutorial.rst
new/Werkzeug-2.0.3/docs/tutorial.rst
--- old/Werkzeug-2.0.2/docs/tutorial.rst 2021-08-07 17:29:04.000000000
+0200
+++ new/Werkzeug-2.0.3/docs/tutorial.rst 2022-01-29 19:37:01.000000000
+0100
@@ -138,7 +138,9 @@
class Shortly(object):
def __init__(self, config):
- self.redis = redis.Redis(config['redis_host'],
config['redis_port'])
+ self.redis = redis.Redis(
+ config['redis_host'], config['redis_port'],
decode_responses=True
+ )
def dispatch_request(self, request):
return Response('Hello World!')
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/examples/shortly/shortly.py
new/Werkzeug-2.0.3/examples/shortly/shortly.py
--- old/Werkzeug-2.0.2/examples/shortly/shortly.py 2021-02-12
18:26:46.000000000 +0100
+++ new/Werkzeug-2.0.3/examples/shortly/shortly.py 2022-01-29
19:37:01.000000000 +0100
@@ -37,7 +37,9 @@
class Shortly:
def __init__(self, config):
- self.redis = redis.Redis(config["redis_host"], config["redis_port"])
+ self.redis = redis.Redis(
+ config["redis_host"], config["redis_port"], decode_responses=True
+ )
template_path = os.path.join(os.path.dirname(__file__), "templates")
self.jinja_env = Environment(
loader=FileSystemLoader(template_path), autoescape=True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/requirements/dev.txt
new/Werkzeug-2.0.3/requirements/dev.txt
--- old/Werkzeug-2.0.2/requirements/dev.txt 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/requirements/dev.txt 2022-02-07 21:34:36.000000000
+0100
@@ -1,159 +1,56 @@
+# SHA1:54b5b77ec8c7a0064ffa93b2fd16cb0130ba177c
#
-# This file is autogenerated by pip-compile with python 3.9
+# This file is autogenerated by pip-compile-multi
# To update, run:
#
-# pip-compile requirements/dev.in
+# pip-compile-multi
#
-alabaster==0.7.12
- # via sphinx
-attrs==21.2.0
- # via pytest
-babel==2.9.1
- # via sphinx
-backports.entry-points-selectable==1.1.0
- # via virtualenv
-certifi==2021.5.30
- # via requests
-cffi==1.14.6
- # via cryptography
+-r docs.txt
+-r tests.txt
+-r typing.txt
cfgv==3.3.1
# via pre-commit
-charset-normalizer==2.0.6
- # via requests
-click==8.0.1
- # via pip-tools
-cryptography==35.0.0
- # via -r requirements/tests.in
-distlib==0.3.3
+click==8.0.3
+ # via
+ # pip-compile-multi
+ # pip-tools
+distlib==0.3.4
# via virtualenv
-docutils==0.17.1
- # via sphinx
-filelock==3.3.0
+filelock==3.4.2
# via
# tox
# virtualenv
-greenlet==1.1.2
+greenlet==1.1.2 ; python_version < "3.11"
# via -r requirements/tests.in
-identify==2.3.0
+identify==2.4.8
# via pre-commit
-idna==3.2
- # via requests
-imagesize==1.2.0
- # via sphinx
-iniconfig==1.1.1
- # via pytest
-jinja2==3.0.2
- # via sphinx
-markupsafe==2.0.1
- # via jinja2
-mypy==0.910
- # via -r requirements/typing.in
-mypy-extensions==0.4.3
- # via mypy
nodeenv==1.6.0
# via pre-commit
-packaging==21.0
- # via
- # pallets-sphinx-themes
- # pytest
- # sphinx
- # tox
-pallets-sphinx-themes==2.0.1
- # via -r requirements/docs.in
-pep517==0.11.0
+pep517==0.12.0
# via pip-tools
-pip-tools==6.3.0
+pip-compile-multi==2.4.3
# via -r requirements/dev.in
-platformdirs==2.4.0
+pip-tools==6.5.0
+ # via pip-compile-multi
+platformdirs==2.4.1
# via virtualenv
-pluggy==1.0.0
- # via
- # pytest
- # tox
-pre-commit==2.15.0
+pre-commit==2.17.0
# via -r requirements/dev.in
-psutil==5.8.0
- # via pytest-xprocess
-py==1.10.0
- # via
- # pytest
- # tox
-pycparser==2.20
- # via cffi
-pygments==2.10.0
- # via sphinx
-pyparsing==2.4.7
- # via packaging
-pytest==6.2.5
- # via
- # -r requirements/tests.in
- # pytest-timeout
- # pytest-xprocess
-pytest-timeout==1.4.2
- # via -r requirements/tests.in
-pytest-xprocess==0.18.1
- # via -r requirements/tests.in
-pytz==2021.3
- # via babel
-pyyaml==5.4.1
+pyyaml==6.0
# via pre-commit
-requests==2.26.0
- # via sphinx
six==1.16.0
# via
# tox
# virtualenv
-snowballstemmer==2.1.0
- # via sphinx
-sphinx==4.2.0
- # via
- # -r requirements/docs.in
- # pallets-sphinx-themes
- # sphinx-issues
- # sphinxcontrib-log-cabinet
-sphinx-issues==1.2.0
- # via -r requirements/docs.in
-sphinxcontrib-applehelp==1.0.2
- # via sphinx
-sphinxcontrib-devhelp==1.0.2
- # via sphinx
-sphinxcontrib-htmlhelp==2.0.0
- # via sphinx
-sphinxcontrib-jsmath==1.0.1
- # via sphinx
-sphinxcontrib-log-cabinet==1.0.1
- # via -r requirements/docs.in
-sphinxcontrib-qthelp==1.0.3
- # via sphinx
-sphinxcontrib-serializinghtml==1.1.5
- # via sphinx
-toml==0.10.2
- # via
- # mypy
- # pre-commit
- # pytest
- # tox
-tomli==1.2.1
- # via pep517
-tox==3.24.4
+toposort==1.7
+ # via pip-compile-multi
+tox==3.24.5
# via -r requirements/dev.in
-types-contextvars==0.1.4
- # via -r requirements/typing.in
-types-dataclasses==0.1.7
- # via -r requirements/typing.in
-types-setuptools==57.4.0
- # via -r requirements/typing.in
-typing-extensions==3.10.0.2
- # via mypy
-urllib3==1.26.7
- # via requests
-virtualenv==20.8.1
+virtualenv==20.13.1
# via
# pre-commit
# tox
-watchdog==2.1.6
- # via -r requirements/tests.in
-wheel==0.37.0
+wheel==0.37.1
# via pip-tools
# The following packages are considered to be unsafe in a requirements file:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/requirements/docs.txt
new/Werkzeug-2.0.3/requirements/docs.txt
--- old/Werkzeug-2.0.2/requirements/docs.txt 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/requirements/docs.txt 2022-02-07 20:13:39.000000000
+0100
@@ -1,50 +1,51 @@
+# SHA1:45c590f97fe95b8bdc755eef796e91adf5fbe4ea
#
-# This file is autogenerated by pip-compile with python 3.9
+# This file is autogenerated by pip-compile-multi
# To update, run:
#
-# pip-compile requirements/docs.in
+# pip-compile-multi
#
alabaster==0.7.12
# via sphinx
babel==2.9.1
# via sphinx
-certifi==2021.5.30
+certifi==2021.10.8
# via requests
-charset-normalizer==2.0.6
+charset-normalizer==2.0.11
# via requests
docutils==0.17.1
# via sphinx
-idna==3.2
+idna==3.3
# via requests
-imagesize==1.2.0
+imagesize==1.3.0
# via sphinx
-jinja2==3.0.2
+jinja2==3.0.3
# via sphinx
markupsafe==2.0.1
# via jinja2
-packaging==21.0
+packaging==21.3
# via
# pallets-sphinx-themes
# sphinx
-pallets-sphinx-themes==2.0.1
+pallets-sphinx-themes==2.0.2
# via -r requirements/docs.in
-pygments==2.10.0
+pygments==2.11.2
# via sphinx
-pyparsing==2.4.7
+pyparsing==3.0.7
# via packaging
pytz==2021.3
# via babel
-requests==2.26.0
+requests==2.27.1
# via sphinx
-snowballstemmer==2.1.0
+snowballstemmer==2.2.0
# via sphinx
-sphinx==4.2.0
+sphinx==4.4.0
# via
# -r requirements/docs.in
# pallets-sphinx-themes
# sphinx-issues
# sphinxcontrib-log-cabinet
-sphinx-issues==1.2.0
+sphinx-issues==3.0.1
# via -r requirements/docs.in
sphinxcontrib-applehelp==1.0.2
# via sphinx
@@ -60,8 +61,5 @@
# via sphinx
sphinxcontrib-serializinghtml==1.1.5
# via sphinx
-urllib3==1.26.7
+urllib3==1.26.8
# via requests
-
-# The following packages are considered to be unsafe in a requirements file:
-# setuptools
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/requirements/tests.txt
new/Werkzeug-2.0.3/requirements/tests.txt
--- old/Werkzeug-2.0.2/requirements/tests.txt 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/requirements/tests.txt 2022-02-07 21:34:36.000000000
+0100
@@ -1,37 +1,38 @@
+# SHA1:36b07d36a8395bd7fd19df122dcf5e9d884d4922
#
-# This file is autogenerated by pip-compile with python 3.9
+# This file is autogenerated by pip-compile-multi
# To update, run:
#
-# pip-compile requirements/tests.in
+# pip-compile-multi
#
-attrs==21.2.0
+attrs==21.4.0
# via pytest
-cffi==1.14.6
+cffi==1.15.0
# via cryptography
-cryptography==35.0.0
+cryptography==36.0.1
# via -r requirements/tests.in
-greenlet==1.1.2
+greenlet==1.1.2 ; python_version < "3.11"
# via -r requirements/tests.in
iniconfig==1.1.1
# via pytest
-packaging==21.0
+packaging==21.3
# via pytest
pluggy==1.0.0
# via pytest
-psutil==5.8.0
+psutil==5.9.0
# via pytest-xprocess
-py==1.10.0
+py==1.11.0
# via pytest
-pycparser==2.20
+pycparser==2.21
# via cffi
-pyparsing==2.4.7
+pyparsing==3.0.7
# via packaging
pytest==6.2.5
# via
# -r requirements/tests.in
# pytest-timeout
# pytest-xprocess
-pytest-timeout==1.4.2
+pytest-timeout==2.1.0
# via -r requirements/tests.in
pytest-xprocess==0.18.1
# via -r requirements/tests.in
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/requirements/typing.txt
new/Werkzeug-2.0.3/requirements/typing.txt
--- old/Werkzeug-2.0.2/requirements/typing.txt 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/requirements/typing.txt 2022-02-07 20:13:41.000000000
+0100
@@ -1,20 +1,21 @@
+# SHA1:95499f7e92b572adde012b13e1ec99dbbb2f7089
#
-# This file is autogenerated by pip-compile with python 3.9
+# This file is autogenerated by pip-compile-multi
# To update, run:
#
-# pip-compile requirements/typing.in
+# pip-compile-multi
#
-mypy==0.910
+mypy==0.931
# via -r requirements/typing.in
mypy-extensions==0.4.3
# via mypy
-toml==0.10.2
+tomli==2.0.0
# via mypy
-types-contextvars==0.1.4
+types-contextvars==2.4.2
# via -r requirements/typing.in
-types-dataclasses==0.1.7
+types-dataclasses==0.6.4
# via -r requirements/typing.in
-types-setuptools==57.4.0
+types-setuptools==57.4.9
# via -r requirements/typing.in
-typing-extensions==3.10.0.2
+typing-extensions==4.0.1
# via mypy
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/setup.cfg new/Werkzeug-2.0.3/setup.cfg
--- old/Werkzeug-2.0.2/setup.cfg 2021-10-06 02:26:29.742697200 +0200
+++ new/Werkzeug-2.0.3/setup.cfg 2022-02-07 22:02:50.243791800 +0100
@@ -34,7 +34,7 @@
[options]
packages = find:
package_dir = = src
-include_package_data = true
+include_package_data = True
python_requires = >= 3.6
[options.packages.find]
@@ -72,6 +72,7 @@
[mypy]
files = src/werkzeug
python_version = 3.6
+show_error_codes = True
allow_redefinition = True
disallow_subclassing_any = True
disallow_untyped_defs = True
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/Werkzeug.egg-info/PKG-INFO
new/Werkzeug-2.0.3/src/Werkzeug.egg-info/PKG-INFO
--- old/Werkzeug-2.0.2/src/Werkzeug.egg-info/PKG-INFO 2021-10-06
02:26:29.000000000 +0200
+++ new/Werkzeug-2.0.3/src/Werkzeug.egg-info/PKG-INFO 2022-02-07
22:02:50.000000000 +0100
@@ -1,6 +1,6 @@
Metadata-Version: 2.1
Name: Werkzeug
-Version: 2.0.2
+Version: 2.0.3
Summary: The comprehensive WSGI web application library.
Home-page: https://palletsprojects.com/p/werkzeug/
Author: Armin Ronacher
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/__init__.py
new/Werkzeug-2.0.3/src/werkzeug/__init__.py
--- old/Werkzeug-2.0.2/src/werkzeug/__init__.py 2021-10-06 02:26:02.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/__init__.py 2022-02-07 22:02:15.000000000
+0100
@@ -3,4 +3,4 @@
from .wrappers import Request as Request
from .wrappers import Response as Response
-__version__ = "2.0.2"
+__version__ = "2.0.3"
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/_internal.py
new/Werkzeug-2.0.3/src/werkzeug/_internal.py
--- old/Werkzeug-2.0.2/src/werkzeug/_internal.py 2021-05-18
17:14:30.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/_internal.py 2022-02-07
21:34:36.000000000 +0100
@@ -30,11 +30,11 @@
for _i in chain(range(32), range(127, 256)):
_cookie_quoting_map[_i.to_bytes(1, sys.byteorder)] =
f"\\{_i:03o}".encode("latin1")
-_octal_re = re.compile(br"\\[0-3][0-7][0-7]")
-_quote_re = re.compile(br"[\\].")
-_legal_cookie_chars_re = br"[\w\d!#%&\'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
+_octal_re = re.compile(rb"\\[0-3][0-7][0-7]")
+_quote_re = re.compile(rb"[\\].")
+_legal_cookie_chars_re = rb"[\w\d!#%&\'~_`><@,:/\$\*\+\-\.\^\|\)\(\?\}\{\=]"
_cookie_re = re.compile(
- br"""
+ rb"""
(?P<key>[^=;]+)
(?:\s*=\s*
(?P<val>
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/datastructures.pyi
new/Werkzeug-2.0.3/src/werkzeug/datastructures.pyi
--- old/Werkzeug-2.0.2/src/werkzeug/datastructures.pyi 2021-10-06
02:06:50.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/datastructures.pyi 2022-02-07
21:34:36.000000000 +0100
@@ -41,15 +41,15 @@
def __hash__(self) -> int: ... # type: ignore
def __delitem__(self, key: Union[SupportsIndex, slice]) -> NoReturn: ...
def __iadd__(self, other: t.Any) -> NoReturn: ... # type: ignore
- def __imul__(self, other: int) -> NoReturn: ...
+ def __imul__(self, other: SupportsIndex) -> NoReturn: ...
def __setitem__( # type: ignore
self, key: Union[int, slice], value: V
) -> NoReturn: ...
def append(self, value: V) -> NoReturn: ...
def remove(self, value: V) -> NoReturn: ...
def extend(self, values: Iterable[V]) -> NoReturn: ...
- def insert(self, pos: int, value: V) -> NoReturn: ...
- def pop(self, index: int = -1) -> NoReturn: ...
+ def insert(self, pos: SupportsIndex, value: V) -> NoReturn: ...
+ def pop(self, index: SupportsIndex = -1) -> NoReturn: ...
def reverse(self) -> NoReturn: ...
def sort(
self, key: Optional[Callable[[V], Any]] = None, reverse: bool = False
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/debug/__init__.py
new/Werkzeug-2.0.3/src/werkzeug/debug/__init__.py
--- old/Werkzeug-2.0.2/src/werkzeug/debug/__init__.py 2021-08-07
17:29:04.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/debug/__init__.py 2022-02-07
21:34:36.000000000 +0100
@@ -90,11 +90,9 @@
pass
# On Windows, use winreg to get the machine guid.
- try:
+ if sys.platform == "win32":
import winreg
- except ImportError:
- pass
- else:
+
try:
with winreg.OpenKey(
winreg.HKEY_LOCAL_MACHINE,
@@ -107,7 +105,7 @@
guid, guid_type = winreg.QueryValueEx(rk, "MachineGuid")
if guid_type == winreg.REG_SZ:
- return guid.encode("utf-8") # type: ignore
+ return guid.encode("utf-8")
return guid
except OSError:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/debug/console.py
new/Werkzeug-2.0.3/src/werkzeug/debug/console.py
--- old/Werkzeug-2.0.2/src/werkzeug/debug/console.py 2021-08-06
18:41:42.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/debug/console.py 2022-02-07
21:34:36.000000000 +0100
@@ -141,12 +141,15 @@
super().__init__(locals)
original_compile = self.compile
- def compile(source: str, filename: str, symbol: str) -> CodeType:
+ def compile(source: str, filename: str, symbol: str) ->
t.Optional[CodeType]:
code = original_compile(source, filename, symbol)
- self.loader.register(code, source)
+
+ if code is not None:
+ self.loader.register(code, source)
+
return code
- self.compile = compile
+ self.compile = compile # type: ignore[assignment]
self.more = False
self.buffer: t.List[str] = []
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/debug/tbtools.py
new/Werkzeug-2.0.3/src/werkzeug/debug/tbtools.py
--- old/Werkzeug-2.0.2/src/werkzeug/debug/tbtools.py 2021-10-06
02:16:09.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/debug/tbtools.py 2022-02-07
21:34:36.000000000 +0100
@@ -16,8 +16,8 @@
from ..utils import cached_property
from .console import Console
-_coding_re = re.compile(br"coding[:=]\s*([-\w.]+)")
-_line_re = re.compile(br"^(.*?)$", re.MULTILINE)
+_coding_re = re.compile(rb"coding[:=]\s*([-\w.]+)")
+_line_re = re.compile(rb"^(.*?)$", re.MULTILINE)
_funcdef_re = re.compile(r"^(\s*def\s)|(.*(?<!\w)lambda(:|\s))|^(\s*@)")
HEADER = """\
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/exceptions.py
new/Werkzeug-2.0.3/src/werkzeug/exceptions.py
--- old/Werkzeug-2.0.2/src/werkzeug/exceptions.py 2021-05-18
17:14:30.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/exceptions.py 2022-02-07
21:34:36.000000000 +0100
@@ -57,6 +57,7 @@
from _typeshed.wsgi import WSGIEnvironment
from .datastructures import WWWAuthenticate
from .sansio.response import Response
+ from .wrappers.request import Request as WSGIRequest # noqa: F401
from .wrappers.response import Response as WSGIResponse # noqa: F401
@@ -189,7 +190,7 @@
def get_response(
self,
- environ: t.Optional["WSGIEnvironment"] = None,
+ environ: t.Optional[t.Union["WSGIEnvironment", "WSGIRequest"]] = None,
scope: t.Optional[dict] = None,
) -> "Response":
"""Get a response object. If one was passed to the exception
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/http.py
new/Werkzeug-2.0.3/src/werkzeug/http.py
--- old/Werkzeug-2.0.2/src/werkzeug/http.py 2021-05-18 17:14:30.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/http.py 2022-02-07 21:34:36.000000000
+0100
@@ -445,17 +445,22 @@
encoding = continued_encoding
continued_encoding = encoding
option = unquote_header_value(option)
+
if option_value is not None:
option_value = unquote_header_value(option_value, option ==
"filename")
+
if encoding is not None:
option_value = _unquote(option_value).decode(encoding)
+
if count:
# Continuations append to the existing value. For
# simplicity, this ignores the possibility of
# out-of-order indices, which shouldn't happen anyway.
- options[option] = options.get(option, "") + option_value
+ if option_value is not None:
+ options[option] = options.get(option, "") + option_value
else:
- options[option] = option_value
+ options[option] = option_value # type: ignore[assignment]
+
rest = rest[optmatch.end() :]
result.append(options)
if multiple is False:
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/local.py
new/Werkzeug-2.0.3/src/werkzeug/local.py
--- old/Werkzeug-2.0.2/src/werkzeug/local.py 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/local.py 2022-02-07 21:34:36.000000000
+0100
@@ -66,7 +66,6 @@
# removed, see "Fake" version below.
storage.set({})
-
except (ImportError, _CannotUseContextVar):
class ContextVar: # type: ignore
@@ -233,7 +232,7 @@
rv = getattr(self._local, "stack", []).copy()
rv.append(obj)
self._local.stack = rv
- return rv # type: ignore
+ return rv
def pop(self) -> t.Any:
"""Removes the topmost item from the stack, will return the
@@ -382,19 +381,23 @@
:param f: The built-in function this attribute is accessed through.
Instead of looking up the special method, the function call
is redone on the object.
- :param fallback: Call this method if the proxy is unbound instead of
- raising a :exc:`RuntimeError`.
- :param class_value: Value to return when accessed from the class.
- Used for ``__doc__`` so building docs still works.
+ :param fallback: Return this function if the proxy is unbound
+ instead of raising a :exc:`RuntimeError`.
+ :param is_attr: This proxied name is an attribute, not a function.
+ Call the fallback immediately to get the value.
+ :param class_value: Value to return when accessed from the
+ ``LocalProxy`` class directly. Used for ``__doc__`` so building
+ docs still works.
"""
- __slots__ = ("bind_f", "fallback", "class_value", "name")
+ __slots__ = ("bind_f", "fallback", "is_attr", "class_value", "name")
def __init__(
self,
f: t.Optional[t.Callable] = None,
fallback: t.Optional[t.Callable] = None,
class_value: t.Optional[t.Any] = None,
+ is_attr: bool = False,
) -> None:
bind_f: t.Optional[t.Callable[["LocalProxy", t.Any], t.Callable]]
@@ -417,6 +420,7 @@
self.bind_f = bind_f
self.fallback = fallback
self.class_value = class_value
+ self.is_attr = is_attr
def __set_name__(self, owner: "LocalProxy", name: str) -> None:
self.name = name
@@ -434,7 +438,14 @@
if self.fallback is None:
raise
- return self.fallback.__get__(instance, owner) # type: ignore
+ fallback = self.fallback.__get__(instance, owner) # type: ignore
+
+ if self.is_attr:
+ # __class__ and __doc__ are attributes, not methods.
+ # Call the fallback to get the value.
+ return fallback()
+
+ return fallback
if self.bind_f is not None:
return self.bind_f(instance, obj)
@@ -560,7 +571,7 @@
raise RuntimeError(f"no object bound to {name}") from None
__doc__ = _ProxyLookup( # type: ignore
- class_value=__doc__, fallback=lambda self: type(self).__doc__
+ class_value=__doc__, fallback=lambda self: type(self).__doc__,
is_attr=True
)
# __del__ should only delete the proxy
__repr__ = _ProxyLookup( # type: ignore
@@ -592,7 +603,9 @@
# __weakref__ (__getattr__)
# __init_subclass__ (proxying metaclass not supported)
# __prepare__ (metaclass)
- __class__ = _ProxyLookup(fallback=lambda self: type(self)) # type: ignore
+ __class__ = _ProxyLookup(
+ fallback=lambda self: type(self), is_attr=True
+ ) # type: ignore
__instancecheck__ = _ProxyLookup(lambda self, other: isinstance(other,
self))
__subclasscheck__ = _ProxyLookup(lambda self, other: issubclass(other,
self))
# __class_getitem__ triggered through __getitem__
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/middleware/proxy_fix.py
new/Werkzeug-2.0.3/src/werkzeug/middleware/proxy_fix.py
--- old/Werkzeug-2.0.2/src/werkzeug/middleware/proxy_fix.py 2021-05-18
17:14:30.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/middleware/proxy_fix.py 2022-01-29
19:37:01.000000000 +0100
@@ -163,18 +163,18 @@
x_host = self._get_real_value(self.x_host,
environ_get("HTTP_X_FORWARDED_HOST"))
if x_host:
- environ["HTTP_HOST"] = x_host
- parts = x_host.split(":", 1)
- environ["SERVER_NAME"] = parts[0]
- if len(parts) == 2:
- environ["SERVER_PORT"] = parts[1]
+ environ["HTTP_HOST"] = environ["SERVER_NAME"] = x_host
+ # "]" to check for IPv6 address without port
+ if ":" in x_host and not x_host.endswith("]"):
+ environ["SERVER_NAME"], environ["SERVER_PORT"] =
x_host.rsplit(":", 1)
x_port = self._get_real_value(self.x_port,
environ_get("HTTP_X_FORWARDED_PORT"))
if x_port:
host = environ.get("HTTP_HOST")
if host:
- parts = host.split(":", 1)
- host = parts[0] if len(parts) == 2 else host
+ # "]" to check for IPv6 address without port
+ if ":" in host and not host.endswith("]"):
+ host = host.rsplit(":", 1)[0]
environ["HTTP_HOST"] = f"{host}:{x_port}"
environ["SERVER_PORT"] = x_port
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/routing.py
new/Werkzeug-2.0.3/src/werkzeug/routing.py
--- old/Werkzeug-2.0.2/src/werkzeug/routing.py 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/routing.py 2022-02-07 21:34:36.000000000
+0100
@@ -143,6 +143,7 @@
import typing_extensions as te
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment
+ from .wrappers.request import Request
from .wrappers.response import Response
_rule_re = re.compile(
@@ -266,7 +267,7 @@
def get_response(
self,
- environ: t.Optional["WSGIEnvironment"] = None,
+ environ: t.Optional[t.Union["WSGIEnvironment", "Request"]] = None,
scope: t.Optional[dict] = None,
) -> "Response":
return redirect(self.new_url, self.code)
@@ -1610,7 +1611,7 @@
def bind_to_environ(
self,
- environ: "WSGIEnvironment",
+ environ: t.Union["WSGIEnvironment", "Request"],
server_name: t.Optional[str] = None,
subdomain: t.Optional[str] = None,
) -> "MapAdapter":
@@ -1655,15 +1656,15 @@
:param server_name: an optional server name hint (see above).
:param subdomain: optionally the current subdomain (see above).
"""
- environ = _get_environ(environ)
- wsgi_server_name = get_host(environ).lower()
- scheme = environ["wsgi.url_scheme"]
+ env = _get_environ(environ)
+ wsgi_server_name = get_host(env).lower()
+ scheme = env["wsgi.url_scheme"]
upgrade = any(
v.strip() == "upgrade"
- for v in environ.get("HTTP_CONNECTION", "").lower().split(",")
+ for v in env.get("HTTP_CONNECTION", "").lower().split(",")
)
- if upgrade and environ.get("HTTP_UPGRADE", "").lower() == "websocket":
+ if upgrade and env.get("HTTP_UPGRADE", "").lower() == "websocket":
scheme = "wss" if scheme == "https" else "ws"
if server_name is None:
@@ -1698,7 +1699,7 @@
subdomain = ".".join(filter(None, cur_server_name[:offset]))
def _get_wsgi_string(name: str) -> t.Optional[str]:
- val = environ.get(name)
+ val = env.get(name)
if val is not None:
return _wsgi_decoding_dance(val, self.charset)
return None
@@ -1712,7 +1713,7 @@
script_name,
subdomain,
scheme,
- environ["REQUEST_METHOD"],
+ env["REQUEST_METHOD"],
path_info,
query_args=query_args,
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/sansio/multipart.py
new/Werkzeug-2.0.3/src/werkzeug/sansio/multipart.py
--- old/Werkzeug-2.0.2/src/werkzeug/sansio/multipart.py 2021-05-18
17:14:30.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/sansio/multipart.py 2022-02-07
20:11:20.000000000 +0100
@@ -100,7 +100,7 @@
# epilogue boundary (for empty form-data) hence the matching
# group to understand if it is an epilogue boundary.
self.preamble_re = re.compile(
- br"%s?--%s(--[^\S\n\r]*%s?|[^\S\n\r]*%s)"
+ rb"%s?--%s(--[^\S\n\r]*%s?|[^\S\n\r]*%s)"
% (LINE_BREAK, re.escape(boundary), LINE_BREAK, LINE_BREAK),
re.MULTILINE,
)
@@ -109,7 +109,7 @@
# could be the epilogue boundary hence the matching group to
# understand if it is an epilogue boundary.
self.boundary_re = re.compile(
- br"%s--%s(--[^\S\n\r]*%s?|[^\S\n\r]*%s)"
+ rb"%s--%s(--[^\S\n\r]*%s?|[^\S\n\r]*%s)"
% (LINE_BREAK, re.escape(boundary), LINE_BREAK, LINE_BREAK),
re.MULTILINE,
)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/sansio/request.py
new/Werkzeug-2.0.3/src/werkzeug/sansio/request.py
--- old/Werkzeug-2.0.2/src/werkzeug/sansio/request.py 2021-05-18
17:14:30.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/sansio/request.py 2022-02-07
21:34:36.000000000 +0100
@@ -95,7 +95,7 @@
#: .. versionadded:: 0.6
list_storage_class: t.Type[t.List] = ImmutableList
- user_agent_class = _DeprecatedUserAgent
+ user_agent_class: t.Type[UserAgent] = _DeprecatedUserAgent
"""The class used and returned by the :attr:`user_agent` property to
parse the header. Defaults to
:class:`~werkzeug.user_agent.UserAgent`, which does no parsing. An
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/serving.py
new/Werkzeug-2.0.3/src/werkzeug/serving.py
--- old/Werkzeug-2.0.2/src/werkzeug/serving.py 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/serving.py 2022-02-07 21:34:36.000000000
+0100
@@ -39,7 +39,10 @@
class _SslDummy:
def __getattr__(self, name: str) -> t.Any:
- raise RuntimeError("SSL support unavailable") # noqa: B904
+ raise RuntimeError( # noqa: B904
+ "SSL is unavailable because this Python runtime was not"
+ " compiled with SSL/TLS support."
+ )
ssl = _SslDummy() # type: ignore
@@ -231,7 +234,9 @@
try:
# binary_form=False gives nicer information, but wouldn't be
compatible with
# what Nginx or Apache could return.
- peer_cert = self.connection.getpeercert(binary_form=True)
+ peer_cert = self.connection.getpeercert( # type:
ignore[attr-defined]
+ binary_form=True
+ )
if peer_cert is not None:
# Nginx and Apache use PEM format.
environ["SSL_CLIENT_CERT"] =
ssl.DER_cert_to_PEM_cert(peer_cert)
@@ -722,7 +727,9 @@
finally:
self.server_close()
- def handle_error(self, request: t.Any, client_address: t.Tuple[str, int])
-> None:
+ def handle_error(
+ self, request: t.Any, client_address: t.Union[t.Tuple[str, int], str]
+ ) -> None:
if self.passthrough_errors:
raise
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/test.py
new/Werkzeug-2.0.3/src/werkzeug/test.py
--- old/Werkzeug-2.0.2/src/werkzeug/test.py 2021-10-06 02:06:50.000000000
+0200
+++ new/Werkzeug-2.0.3/src/werkzeug/test.py 2022-02-07 21:34:36.000000000
+0100
@@ -958,7 +958,9 @@
:meta private:
"""
scheme, netloc, path, qs, anchor = url_parse(response.location)
- builder = EnvironBuilder.from_environ(response.request.environ,
query_string=qs)
+ builder = EnvironBuilder.from_environ(
+ response.request.environ, path=path, query_string=qs
+ )
to_name_parts = netloc.split(":", 1)[0].split(".")
from_name_parts = builder.server_name.split(".")
@@ -1285,6 +1287,9 @@
is made with ``follow_redirects`` enabled.
"""
+ # Tell Pytest to ignore this, it's not a test class.
+ __test__ = False
+
def __init__(
self,
response: t.Iterable[bytes],
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/accept.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/accept.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/accept.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/accept.py 2022-02-07
21:34:36.000000000 +0100
@@ -11,4 +11,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/auth.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/auth.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/auth.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/auth.py 2022-02-07
21:34:36.000000000 +0100
@@ -11,7 +11,7 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
class WWWAuthenticateMixin:
@@ -23,4 +23,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore'
old/Werkzeug-2.0.2/src/werkzeug/wrappers/common_descriptors.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/common_descriptors.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/common_descriptors.py
2021-05-11 08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/common_descriptors.py
2022-02-07 21:34:36.000000000 +0100
@@ -11,7 +11,7 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
class CommonResponseDescriptorsMixin:
@@ -23,4 +23,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/cors.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/cors.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/cors.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/cors.py 2022-02-07
21:34:36.000000000 +0100
@@ -11,7 +11,7 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
class CORSResponseMixin:
@@ -23,4 +23,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/etag.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/etag.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/etag.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/etag.py 2022-02-07
21:34:36.000000000 +0100
@@ -11,7 +11,7 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
class ETagResponseMixin:
@@ -23,4 +23,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/json.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/json.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/json.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/json.py 2022-02-07
21:34:36.000000000 +0100
@@ -10,4 +10,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/request.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/request.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/request.py 2021-08-07
17:29:04.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/request.py 2022-02-07
21:34:36.000000000 +0100
@@ -426,7 +426,7 @@
self._cached_data = rv
if as_text:
rv = rv.decode(self.charset, self.encoding_errors)
- return rv # type: ignore
+ return rv
@cached_property
def form(self) -> "ImmutableMultiDict[str, str]":
@@ -632,7 +632,7 @@
stacklevel=2,
)
kwargs["shallow"] = True
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
class PlainRequest(StreamOnlyMixin, Request):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/response.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/response.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/response.py 2021-08-07
17:29:04.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/response.py 2022-02-07
21:34:36.000000000 +0100
@@ -26,6 +26,7 @@
from _typeshed.wsgi import StartResponse
from _typeshed.wsgi import WSGIApplication
from _typeshed.wsgi import WSGIEnvironment
+ from .request import Request
def _warn_if_string(iterable: t.Iterable) -> None:
@@ -749,7 +750,7 @@
def make_conditional(
self,
- request_or_environ: "WSGIEnvironment",
+ request_or_environ: t.Union["WSGIEnvironment", "Request"],
accept_ranges: t.Union[bool, str] = False,
complete_length: t.Optional[int] = None,
) -> "Response":
@@ -887,4 +888,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/src/werkzeug/wrappers/user_agent.py
new/Werkzeug-2.0.3/src/werkzeug/wrappers/user_agent.py
--- old/Werkzeug-2.0.2/src/werkzeug/wrappers/user_agent.py 2021-05-11
08:00:07.000000000 +0200
+++ new/Werkzeug-2.0.3/src/werkzeug/wrappers/user_agent.py 2022-02-07
21:34:36.000000000 +0100
@@ -11,4 +11,4 @@
DeprecationWarning,
stacklevel=2,
)
- super().__init__(*args, **kwargs) # type: ignore
+ super().__init__(*args, **kwargs)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/tests/middleware/test_proxy_fix.py
new/Werkzeug-2.0.3/tests/middleware/test_proxy_fix.py
--- old/Werkzeug-2.0.2/tests/middleware/test_proxy_fix.py 2021-02-12
19:11:39.000000000 +0100
+++ new/Werkzeug-2.0.3/tests/middleware/test_proxy_fix.py 2022-01-29
19:37:01.000000000 +0100
@@ -138,6 +138,24 @@
"http://spam/eggs/",
id="prefix < for",
),
+ pytest.param(
+ {"x_host": 1},
+ {"HTTP_HOST": "spam", "HTTP_X_FORWARDED_HOST": "[2001:db8::a]"},
+ "http://[2001:db8::a]/",
+ id="ipv6 host",
+ ),
+ pytest.param(
+ {"x_port": 1},
+ {"HTTP_HOST": "[2001:db8::a]", "HTTP_X_FORWARDED_PORT": "8080"},
+ "http://[2001:db8::a]:8080/",
+ id="ipv6 port, host without port",
+ ),
+ pytest.param(
+ {"x_port": 1},
+ {"HTTP_HOST": "[2001:db8::a]:9000", "HTTP_X_FORWARDED_PORT":
"8080"},
+ "http://[2001:db8::a]:8080/",
+ id="ipv6 - port, host with port",
+ ),
),
)
def test_proxy_fix(kwargs, base, url_root):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/tests/test_datastructures.py
new/Werkzeug-2.0.3/tests/test_datastructures.py
--- old/Werkzeug-2.0.2/tests/test_datastructures.py 2021-10-06
02:06:50.000000000 +0200
+++ new/Werkzeug-2.0.3/tests/test_datastructures.py 2022-02-07
21:34:36.000000000 +0100
@@ -1162,13 +1162,15 @@
for name in ("fileno", "writable", "readable", "seekable"):
assert hasattr(file_storage, name)
-
@pytest.mark.filterwarnings("ignore::pytest.PytestUnraisableExceptionWarning")
def test_save_to_pathlib_dst(self, tmp_path):
src = tmp_path / "src.txt"
src.write_text("test")
- storage = self.storage_class(src.open("rb"))
dst = tmp_path / "dst.txt"
- storage.save(dst)
+
+ with src.open("rb") as f:
+ storage = self.storage_class(f)
+ storage.save(dst)
+
assert dst.read_text() == "test"
def test_save_to_bytes_io(self):
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/tests/test_local.py
new/Werkzeug-2.0.3/tests/test_local.py
--- old/Werkzeug-2.0.2/tests/test_local.py 2021-05-21 05:59:47.000000000
+0200
+++ new/Werkzeug-2.0.3/tests/test_local.py 2022-02-07 21:34:36.000000000
+0100
@@ -17,7 +17,6 @@
def run_async(coro):
return asyncio.get_event_loop().run_until_complete(coro)
-
else:
def run_async(coro):
@@ -226,13 +225,20 @@
def test_proxy_fallback():
- def _raises():
- raise RuntimeError()
+ local_stack = local.LocalStack()
+ local_proxy = local_stack()
- local_proxy = local.LocalProxy(_raises)
assert repr(local_proxy) == "<LocalProxy unbound>"
assert isinstance(local_proxy, local.LocalProxy)
- assert not isinstance(local_proxy, Thread)
+ assert local_proxy.__class__ is local.LocalProxy
+ assert "LocalProxy" in local_proxy.__doc__
+
+ local_stack.push(42)
+
+ assert repr(local_proxy) == "42"
+ assert isinstance(local_proxy, int)
+ assert local_proxy.__class__ is int
+ assert "int(" in local_proxy.__doc__
def test_proxy_unbound():
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/tests/test_test.py
new/Werkzeug-2.0.3/tests/test_test.py
--- old/Werkzeug-2.0.2/tests/test_test.py 2021-03-30 21:33:20.000000000
+0200
+++ new/Werkzeug-2.0.3/tests/test_test.py 2022-02-07 21:34:36.000000000
+0100
@@ -314,7 +314,7 @@
def test_environ_builder_unicode_file_mix():
for use_tempfile in False, True:
- f = FileStorage(BytesIO(br"\N{SNOWMAN}"), "snowman.txt")
+ f = FileStorage(BytesIO(rb"\N{SNOWMAN}"), "snowman.txt")
d = MultiDict(dict(f=f, s="\N{SNOWMAN}"))
stream, length, boundary = stream_encode_multipart(
d, use_tempfile, threshold=150
@@ -331,7 +331,7 @@
assert form["s"] == "\N{SNOWMAN}"
assert files["f"].name == "f"
assert files["f"].filename == "snowman.txt"
- assert files["f"].read() == br"\N{SNOWMAN}"
+ assert files["f"].read() == rb"\N{SNOWMAN}"
stream.close()
@@ -872,6 +872,22 @@
assert response.get_data(as_text=True) == "/?\n/%3f?"
+def test_raw_request_uri_redirect():
+ @Request.application
+ def app(request):
+ if request.path == "/first":
+ return redirect("/second")
+
+ path_info = request.path
+ request_uri = request.environ["REQUEST_URI"]
+ return Response("\n".join((path_info, request_uri)))
+
+ client = Client(app)
+ response = client.get("/first", follow_redirects=True)
+ data = response.get_data(as_text=True)
+ assert data == "/second\n/second"
+
+
def test_deprecated_tuple():
app = Request.application(lambda r: Response())
client = Client(app)
diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn'
'--exclude=.svnignore' old/Werkzeug-2.0.2/tox.ini new/Werkzeug-2.0.3/tox.ini
--- old/Werkzeug-2.0.2/tox.ini 2021-02-25 19:14:52.000000000 +0100
+++ new/Werkzeug-2.0.3/tox.ini 2022-02-07 21:34:36.000000000 +0100
@@ -1,6 +1,6 @@
[tox]
envlist =
- py{39,38,37,36,py3}
+ py3{11,10,9,8,7,6},pypy3{8,7}
style
typing
docs
@@ -8,7 +8,6 @@
[testenv]
deps = -r requirements/tests.txt
-passenv = CI
commands = pytest -v --tb=short --basetemp={envtmpdir} {posargs}
[testenv:style]