Update to 2.2.3

This commit is contained in:
wu-leilei 2023-05-09 19:15:41 +08:00
parent 04eacdd4b6
commit 9020e9e70b
5 changed files with 73 additions and 47 deletions

Binary file not shown.

BIN
Werkzeug-2.2.3.tar.gz Normal file

Binary file not shown.

View File

@ -1,39 +0,0 @@
From 60e83271dce5cc019dbfc0935052da0904a5d425 Mon Sep 17 00:00:00 2001
From: Hongkuan Wang <hongkuan.wang@aalto.fi>
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

61
ephemeral_port_reserve.py Executable file
View File

@ -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())

View File

@ -1,16 +1,16 @@
%global _empty_manifest_terminate_build 0 %global _empty_manifest_terminate_build 0
Name: python-werkzeug Name: python-werkzeug
Version: 2.0.3 Version: 2.2.3
Release: 2 Release: 1
Summary: The comprehensive WSGI web application library. Summary: The comprehensive WSGI web application library.
License: BSD-3-Clause License: BSD-3-Clause
URL: https://palletsprojects.com/p/werkzeug/ URL: https://palletsprojects.com/p/werkzeug/
Source0: https://files.pythonhosted.org/packages/6c/a8/60514fade2318e277453c9588545d0c335ea3ea6440ce5cdabfca7f73117/Werkzeug-2.0.3.tar.gz Source0: https://files.pythonhosted.org/packages/source/W/Werkzeug/Werkzeug-2.2.3.tar.gz
# for test
Patch0001: backport-fix-typo-and-grammar-mistake.patch Source1: https://github.com/Yelp/ephemeral-port-reserve/blob/master/ephemeral_port_reserve.py
BuildArch: noarch BuildArch: noarch
BuildRequires: python3-werkzeug BuildRequires: python3-werkzeug python3-markupsafe
Requires: python3-pytest Requires: python3-pytest
Requires: python3-pytest-xprocess Requires: python3-pytest-xprocess
@ -127,7 +127,8 @@ providing more structure and patterns for defining powerful
applications. applications.
%prep %prep
%autosetup -n Werkzeug-2.0.3 -p1 %autosetup -n Werkzeug-%{version} -p1
cp %{SOURCE1} %{_builddir}/Werkzeug-%{version}/tests/
%build %build
%py3_build %py3_build
@ -161,7 +162,7 @@ mv %{buildroot}/filelist.lst .
mv %{buildroot}/doclist.lst . mv %{buildroot}/doclist.lst .
%check %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 %files -n python3-werkzeug -f filelist.lst
%dir %{python3_sitelib}/* %dir %{python3_sitelib}/*
@ -170,6 +171,9 @@ PYTHONPATH=%{buildroot}%{python3_sitelib} pytest -k "not (test_reloader_sys_path
%{_docdir}/* %{_docdir}/*
%changelog %changelog
* Tue May 09 2023 wulei <wu_lei@hoperun.com> - 2.2.3-1
- Update to 2.2.3
* Sat Jan 7 2023 Bolehu <heyaohua@xfusion.com> - 2.0.3-2 * Sat Jan 7 2023 Bolehu <heyaohua@xfusion.com> - 2.0.3-2
- fix typo and grammar mistake - fix typo and grammar mistake