diff --git a/2681.patch b/2681.patch new file mode 100644 index 0000000000000000000000000000000000000000..9a7be9bd8b667ab143f9e59466cfeae54bf32c26 --- /dev/null +++ b/2681.patch @@ -0,0 +1,45 @@ +From 0684b61c1d4feaaf5ac3c2d50375cf504214a48d Mon Sep 17 00:00:00 2001 +From: Petr Viktorin +Date: Wed, 19 Jun 2019 18:09:17 +0200 +Subject: [PATCH] gen.with_timeout: Don't log CancelledError after timeout + +See also: commit a237a995a1d54ad6e07c1ecdf5103ff8f45073b5 +--- + tornado/gen.py | 10 ++++++++-- + 1 file changed, 8 insertions(+), 2 deletions(-) + +diff --git a/tornado/gen.py b/tornado/gen.py +index 51f2a4f03..33cc887e5 100644 +--- a/tornado/gen.py ++++ b/tornado/gen.py +@@ -557,8 +557,9 @@ def with_timeout( + an absolute time relative to `.IOLoop.time`) + + If the wrapped `.Future` fails after it has timed out, the exception +- will be logged unless it is of a type contained in ``quiet_exceptions`` +- (which may be an exception type or a sequence of types). ++ will be logged unless it is either of a type contained in ++ ``quiet_exceptions`` (which may be an exception type or a sequence of ++ types), or a `CancelledError`. + + The wrapped `.Future` is not canceled when the timeout expires, + permitting it to be reused. `asyncio.wait_for` is similar to this +@@ -573,6 +574,9 @@ def with_timeout( + .. versionchanged:: 4.4 + Added support for yieldable objects other than `.Future`. + ++ .. versionchanged:: 6.1 ++ Do not log CancelledError after timeout. ++ + """ + # It's tempting to optimize this by cancelling the input future on timeout + # instead of creating a new one, but A) we can't know if we are the only +@@ -587,6 +591,8 @@ def with_timeout( + def error_callback(future: Future) -> None: + try: + future.result() ++ except asyncio.CancelledError: ++ pass + except Exception as e: + if not isinstance(e, quiet_exceptions): + app_log.error( diff --git a/Do-not-turn-DeprecationWarning-into-Exception.patch b/Do-not-turn-DeprecationWarning-into-Exception.patch new file mode 100644 index 0000000000000000000000000000000000000000..2e55e7a4b1c88729414206a9844426616ba1268d --- /dev/null +++ b/Do-not-turn-DeprecationWarning-into-Exception.patch @@ -0,0 +1,24 @@ +From 58f264d25c9dc427733a6a72fedc7b0e3b9c8e06 Mon Sep 17 00:00:00 2001 +From: Lumir Balhar +Date: Thu, 16 May 2019 13:50:14 +0200 +Subject: [PATCH] Do not turn DeprecationWarning into Exception + +--- + tornado/test/runtests.py | 1 - + 1 file changed, 1 deletion(-) + +diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py +index dab76a2..117fd1c 100644 +--- a/tornado/test/runtests.py ++++ b/tornado/test/runtests.py +@@ -124,7 +124,6 @@ def main(): + # Tornado generally shouldn't use anything deprecated, but some of + # our dependencies do (last match wins). + warnings.filterwarnings("ignore", category=DeprecationWarning) +- warnings.filterwarnings("error", category=DeprecationWarning, module=r"tornado\..*") + warnings.filterwarnings("ignore", category=PendingDeprecationWarning) + warnings.filterwarnings( + "error", category=PendingDeprecationWarning, module=r"tornado\..*" +-- +2.21.0 + diff --git a/fix-erroneous-deprecation-warnings.patch b/fix-erroneous-deprecation-warnings.patch deleted file mode 100644 index 6592feb71126458d167ed54b63dfebde87260acb..0000000000000000000000000000000000000000 --- a/fix-erroneous-deprecation-warnings.patch +++ /dev/null @@ -1,13 +0,0 @@ -diff --git a/tornado/test/runtests.py b/tornado/test/runtests.py -index d5bd769..e4f938d 100644 ---- a/tornado/test/runtests.py -+++ b/tornado/test/runtests.py -@@ -137,6 +137,8 @@ def main(): - # 2.7 and 3.2 - warnings.filterwarnings("ignore", category=DeprecationWarning, - message="Please use assert.* instead") -+ warnings.filterwarnings("ignore", category=PendingDeprecationWarning, -+ message="Please use assert.* instead") - # Twisted 15.0.0 triggers some warnings on py3 with -bb. - warnings.filterwarnings("ignore", category=BytesWarning, - module=r"twisted\..*") diff --git a/python-tornado.spec b/python-tornado.spec index 29c78ae4dbe6992d4c18e784cfebb22c1df1a098..273a25ed8ca8ba80270f24ef2ebad0352e12605e 100644 --- a/python-tornado.spec +++ b/python-tornado.spec @@ -1,32 +1,61 @@ -Name: python-tornado -Version: 5.0.2 -Release: 7 -Summary: a Python web framework and asynchronous networking library -License: ASL 2.0 -URL: http://www.tornadoweb.org -Source0: https://files.pythonhosted.org/packages/source/t/tornado/tornado-%{version}.tar.gz -Patch0: fix-erroneous-deprecation-warnings.patch +%global srcname tornado -BuildRequires: python3-devel gcc +Name: python-%{srcname} +Version: 6.0.2 +Release: 1 +Summary: Scalable, non-blocking web server and tools + +License: ASL 2.0 +URL: http://www.tornadoweb.org +Source0: %{pypi_source} + +# Do not turn DeprecationWarning in tornado module into Exception +# fixes FTBFS with Python 3.8 +Patch1: Do-not-turn-DeprecationWarning-into-Exception.patch +Patch2: 2681.patch + +BuildRequires: gcc + +BuildRequires: python%{python3_pkgversion}-setuptools +BuildRequires: python%{python3_pkgversion}-devel %description -Tornado is a Python web framework and asynchronous networking library, originally -developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to -tens of thousands of open connections, making it ideal for long polling, WebSockets, -and other applications that require a long-lived connection to each user. - -%package -n python3-tornado -Summary: a Python web framework and asynchronous networking library -Requires: python3-pycurl - -%description -n python3-tornado -Tornado is a Python web framework and asynchronous networking library, originally -developed at FriendFeed. By using non-blocking network I/O, Tornado can scale to -tens of thousands of open connections, making it ideal for long polling, WebSockets, -and other applications that require a long-lived connection to each user. - -%prep -%autosetup -n tornado-%{version} -p1 +Tornado is an open source version of the scalable, non-blocking web +server and tools. + +The framework is distinct from most mainstream web server frameworks +(and certainly most Python frameworks) because it is non-blocking and +reasonably fast. Because it is non-blocking and uses epoll, it can +handle thousands of simultaneous standing connections, which means it is +ideal for real-time web services. + +%package -n python%{python3_pkgversion}-%{srcname} +Summary: Scalable, non-blocking web server and tools +%{?python_provide:%python_provide python%{python3_pkgversion}-%{srcname}} +Requires: python%{python3_pkgversion}-pycurl + +%description -n python%{python3_pkgversion}-%{srcname} +Tornado is an open source version of the scalable, non-blocking web +server and tools. + +The framework is distinct from most mainstream web server frameworks +(and certainly most Python frameworks) because it is non-blocking and +reasonably fast. Because it is non-blocking and uses epoll, it can +handle thousands of simultaneous standing connections, which means it is +ideal for real-time web services. + +%package doc +Summary: Examples for python-tornado +Obsoletes: python%{python3_pkgversion}-%{srcname}-doc < 4.2.1-3 +Provides: python%{python3_pkgversion}-%{srcname}-doc = %{version}-%{release} + +%description doc +Tornado is an open source version of the scalable, non-blocking web +server and and tools. This package contains some example applications. + +%prep +%autosetup -p1 -n %{srcname}-%{version} +# remove shebang from files %{__sed} -i.orig -e '/^#!\//, 1d' *py tornado/*.py tornado/*/*.py %build @@ -35,13 +64,19 @@ and other applications that require a long-lived connection to each user. %install %py3_install -%files -n python3-tornado -%defattr(-,root,root) +%files -n python%{python3_pkgversion}-%{srcname} %license LICENSE %doc README.rst -%{python3_sitearch}/* +%{python3_sitearch}/%{srcname}/ +%{python3_sitearch}/%{srcname}-%{version}-*.egg-info + +%files doc +%doc demos %changelog +* Thu Jun 24 2021 CaiYuxin -6.0.2-1 +- Update to 6.0.2 + * Mon May 31 2021 huanghaitao - 5.0.2-7 - Completing build dependencies @@ -49,5 +84,4 @@ and other applications that require a long-lived connection to each user. - Remove python2-tornado subpackage * Tue Dec 10 2019 openEuler Buildteam - 5.0.2-5 -- Package init - +- Package init \ No newline at end of file diff --git a/tornado-5.0.2.tar.gz b/tornado-5.0.2.tar.gz deleted file mode 100644 index 457d44eca6ce046001480bd6fc6a8a4020ff8543..0000000000000000000000000000000000000000 Binary files a/tornado-5.0.2.tar.gz and /dev/null differ diff --git a/tornado-6.0.2.tar.gz b/tornado-6.0.2.tar.gz new file mode 100644 index 0000000000000000000000000000000000000000..16439b102406c2c913e18b567742e8797f8f64cd Binary files /dev/null and b/tornado-6.0.2.tar.gz differ