!31 Update to 2.2.3
From: @wu-leilei Reviewed-by: @lyn1001, @caodongxia Signed-off-by: @caodongxia
This commit is contained in:
commit
a926306299
Binary file not shown.
BIN
Werkzeug-2.2.3.tar.gz
Normal file
BIN
Werkzeug-2.2.3.tar.gz
Normal file
Binary file not shown.
@ -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
61
ephemeral_port_reserve.py
Executable 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())
|
||||
@ -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 <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
|
||||
- fix typo and grammar mistake
|
||||
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user