diff --git a/Werkzeug-2.0.3.tar.gz b/Werkzeug-2.0.3.tar.gz deleted file mode 100644 index 207ede1acfc4f3a96ded10e04fad12bb93e48880..0000000000000000000000000000000000000000 Binary files a/Werkzeug-2.0.3.tar.gz and /dev/null differ diff --git a/Werkzeug-2.2.3.tar.gz b/Werkzeug-2.2.3.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..b87ab26ca991e90f9e4269a5674b712dedd66608 Binary files /dev/null and b/Werkzeug-2.2.3.tar.gz differ diff --git a/backport-fix-typo-and-grammar-mistake.patch b/backport-fix-typo-and-grammar-mistake.patch deleted file mode 100644 index b4d44e7c82e97ab266d66f890dfcefe50ea48ee4..0000000000000000000000000000000000000000 --- a/backport-fix-typo-and-grammar-mistake.patch +++ /dev/null @@ -1,39 +0,0 @@ -From 60e83271dce5cc019dbfc0935052da0904a5d425 Mon Sep 17 00:00:00 2001 -From: Hongkuan Wang -Date: Wed, 22 Sep 2021 22:13:48 +0800 -Subject: [PATCH] fix typo and grammar mistake - ---- - src/werkzeug/filesystem.py | 2 +- - src/werkzeug/test.py | 2 +- - 2 files changed, 2 insertions(+), 2 deletions(-) - -diff --git a/src/werkzeug/filesystem.py b/src/werkzeug/filesystem.py -index 36a3d12e..16eb5861 100644 ---- a/src/werkzeug/filesystem.py -+++ b/src/werkzeug/filesystem.py -@@ -37,7 +37,7 @@ def get_filesystem_encoding() -> str: - because it might be different. See :ref:`filesystem-encoding` for the exact - behavior. - -- The concept of a filesystem encoding in generally is not something you -+ The concept of a filesystem encoding in general is not something you - should rely on. As such if you ever need to use this function except for - writing wrapper code reconsider. - """ -diff --git a/src/werkzeug/test.py b/src/werkzeug/test.py -index d0ce6f95..7ee27477 100644 ---- a/src/werkzeug/test.py -+++ b/src/werkzeug/test.py -@@ -322,7 +322,7 @@ class EnvironBuilder: - - .. versionadded:: 0.15 - The environ has keys ``REQUEST_URI`` and ``RAW_URI`` containing -- the path before perecent-decoding. This is not part of the WSGI -+ the path before percent-decoding. This is not part of the WSGI - PEP, but many WSGI servers include it. - - .. versionchanged:: 0.6 --- -2.33.0 - diff --git a/ephemeral_port_reserve.py b/ephemeral_port_reserve.py new file mode 100755 index 0000000000000000000000000000000000000000..5124b438ae27cf2daf860ccdddf20a9fc012ccdf --- /dev/null +++ b/ephemeral_port_reserve.py @@ -0,0 +1,61 @@ +#!/usr/bin/env python +from __future__ import absolute_import +from __future__ import unicode_literals + +import contextlib +import errno +from socket import error as SocketError +from socket import SO_REUSEADDR +from socket import socket +from socket import SOL_SOCKET + +LOCALHOST = '127.0.0.1' + + +def reserve(ip=LOCALHOST, port=0): + """Bind to an ephemeral port, force it into the TIME_WAIT state, and unbind it. + + This means that further ephemeral port alloctions won't pick this "reserved" port, + but subprocesses can still bind to it explicitly, given that they use SO_REUSEADDR. + By default on linux you have a grace period of 60 seconds to reuse this port. + To check your own particular value: + $ cat /proc/sys/net/ipv4/tcp_fin_timeout + 60 + + By default, the port will be reserved for localhost (aka 127.0.0.1). + To reserve a port for a different ip, provide the ip as the first argument. + Note that IP 0.0.0.0 is interpreted as localhost. + """ + port = int(port) + with contextlib.closing(socket()) as s: + s.setsockopt(SOL_SOCKET, SO_REUSEADDR, 1) + try: + s.bind((ip, port)) + except SocketError as e: + # socket.error: EADDRINUSE Address already in use + if e.errno == errno.EADDRINUSE and port != 0: + s.bind((ip, 0)) + else: + raise + + # the connect below deadlocks on kernel >= 4.4.0 unless this arg is greater than zero + s.listen(1) + + sockname = s.getsockname() + + # these three are necessary just to get the port into a TIME_WAIT state + with contextlib.closing(socket()) as s2: + s2.connect(sockname) + sock, _ = s.accept() + with contextlib.closing(sock): + return sockname[1] + + +def main(): # pragma: no cover + from sys import argv + port = reserve(*argv[1:]) + print(port) + + +if __name__ == '__main__': + exit(main()) diff --git a/python-werkzeug.spec b/python-werkzeug.spec index 6a9250817d2f96a8e9ed8da3b8fdcd087a9a0a4e..430a57faf645bf9812f39893a2d34fb7eb062d09 100644 --- a/python-werkzeug.spec +++ b/python-werkzeug.spec @@ -1,16 +1,16 @@ %global _empty_manifest_terminate_build 0 Name: python-werkzeug -Version: 2.0.3 -Release: 2 +Version: 2.2.3 +Release: 1 Summary: The comprehensive WSGI web application library. License: BSD-3-Clause URL: https://palletsprojects.com/p/werkzeug/ -Source0: https://files.pythonhosted.org/packages/6c/a8/60514fade2318e277453c9588545d0c335ea3ea6440ce5cdabfca7f73117/Werkzeug-2.0.3.tar.gz - -Patch0001: backport-fix-typo-and-grammar-mistake.patch +Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-2.2.3.tar.gz +# for test +Source1: https://github.com/Yelp/ephemeral-port-reserve/blob/master/ephemeral_port_reserve.py BuildArch: noarch -BuildRequires: python3-werkzeug +BuildRequires: python3-werkzeug python3-markupsafe Requires: python3-pytest Requires: python3-pytest-xprocess @@ -127,7 +127,8 @@ providing more structure and patterns for defining powerful applications. %prep -%autosetup -n Werkzeug-2.0.3 -p1 +%autosetup -n Werkzeug-%{version} -p1 +cp %{SOURCE1} %{_builddir}/Werkzeug-%{version}/tests/ %build %py3_build @@ -161,7 +162,7 @@ mv %{buildroot}/filelist.lst . mv %{buildroot}/doclist.lst . %check -PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not (test_reloader_sys_path)" +PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k 'not (test_serving)' %files -n python3-werkzeug -f filelist.lst %dir %{python3_sitelib}/* @@ -170,6 +171,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not (test_reloader_sys_path %{_docdir}/* %changelog +* Tue May 09 2023 wulei - 2.2.3-1 +- Update to 2.2.3 + * Sat Jan 7 2023 Bolehu - 2.0.3-2 - fix typo and grammar mistake