Hello community, here is the log from the commit of package python-curio for openSUSE:Factory checked in at 2020-02-26 15:03:42 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-curio (Old) and /work/SRC/openSUSE:Factory/.python-curio.new.26092 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-curio" Wed Feb 26 15:03:42 2020 rev:3 rq:779020 version:1.0 Changes: -------- --- /work/SRC/openSUSE:Factory/python-curio/python-curio.changes 2019-06-03 18:55:52.464417637 +0200 +++ /work/SRC/openSUSE:Factory/.python-curio.new.26092/python-curio.changes 2020-02-26 15:03:45.073036129 +0100 @@ -1,0 +2,8 @@ +Mon Feb 24 16:03:10 UTC 2020 - Ondřej Súkup <mimi...@gmail.com> + +- update to 1.0 +- minimal python version bump to 3.7 +- please see CHANGES file for detailed changelog +- add gh_313.patch to fix epool problem + +------------------------------------------------------------------- Old: ---- curio-0.9.tar.gz New: ---- curio-1.0.tar.gz gh_313.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-curio.spec ++++++ --- /var/tmp/diff_new_pack.Wvb6JD/_old 2020-02-26 15:03:46.169038315 +0100 +++ /var/tmp/diff_new_pack.Wvb6JD/_new 2020-02-26 15:03:46.173038323 +0100 @@ -1,7 +1,7 @@ # # spec file for package python-curio # -# Copyright (c) 2019 SUSE LINUX GmbH, Nuernberg, Germany. +# Copyright (c) 2020 SUSE LLC # # All modifications and additions to the file contributed by third parties # remain the property of their copyright owners, unless otherwise agreed @@ -19,14 +19,15 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define skip_python2 1 Name: python-curio -Version: 0.9 +Version: 1.0 Release: 0 Summary: Concurrent I/O library for Python 3 License: BSD-Source-Code -Group: Development/Languages/Python URL: https://github.com/dabeaz/curio Source: https://github.com/dabeaz/curio/archive/%{version}.tar.gz#/curio-%{version}.tar.gz -BuildRequires: %{python_module pytest >= 3.6} +Patch0: gh_313.patch +BuildRequires: %{python_module base >= 3.7} +BuildRequires: %{python_module pytest} BuildRequires: %{python_module setuptools} BuildRequires: fdupes BuildRequires: python-rpm-macros @@ -38,6 +39,7 @@ %prep %setup -q -n curio-%{version} +%patch0 -p1 %build %python_build @@ -47,7 +49,8 @@ %python_expand %fdupes %{buildroot}%{$python_sitelib} %check -%pytest +# disabled network tests +%pytest -k 'not (test_ssl_outgoing or test_socket_funcs)' %files %{python_files} %license LICENSE ++++++ curio-0.9.tar.gz -> curio-1.0.tar.gz ++++++ ++++ 21104 lines of diff (skipped) ++++++ gh_313.patch ++++++ >From 3cb182c94fe04dc4afd13c3b36a100c94343fb65 Mon Sep 17 00:00:00 2001 From: David Beazley <d...@dabeaz.com> Date: Mon, 24 Feb 2020 22:29:42 +0000 Subject: [PATCH] Fixed subtle epoll() edge case on Linux. Related to bug #313 --- CHANGES | 9 +++++++++ curio/io.py | 4 +++- curio/kernel.py | 10 ++++++++++ curio/traps.py | 8 +++++++- docs/reference.rst | 3 +++ tests/test_socket.py | 2 +- 6 files changed, 33 insertions(+), 3 deletions(-) Index: curio-1.0/CHANGES =================================================================== --- curio-1.0.orig/CHANGES +++ curio-1.0/CHANGES @@ -1,5 +1,14 @@ CHANGES ------- +Version 1.1 - In Progress + +02/24/2020 Fixed a very subtle edge case involving epoll() and duplicated + file descriptors on Linux. The fix required a new trap + _io_release() to explitly unregister a file descriptor + before closing. This must be embedded in any close() + implementation prior to actually calling close() on a real + file object. No changes should be necessary in existing + user-level Curio code. Bug #313 reported by Ondřej Súkup. Version 1.0 - February 20, 2020 ------------------------------- Index: curio-1.0/curio/io.py =================================================================== --- curio-1.0.orig/curio/io.py +++ curio-1.0/curio/io.py @@ -36,7 +36,7 @@ import os # -- Curio -from .traps import _read_wait, _write_wait +from .traps import _read_wait, _write_wait, _io_release from . import errors from . import thread @@ -286,6 +286,7 @@ class Socket(object): async def close(self): if self._socket: + await _io_release(self._fileno) self._socket.close() self._socket = None self._fileno = -1 @@ -462,6 +463,7 @@ class StreamBase(object): async def close(self): await self.flush() if self._file: + await _io_release(self.fileno) self._file.close() self._file = None self._fileno = -1 Index: curio-1.0/curio/kernel.py =================================================================== --- curio-1.0.orig/curio/kernel.py +++ curio-1.0/curio/kernel.py @@ -283,6 +283,8 @@ class Kernel(object): # Reschedule a task, putting it back on the ready queue. def reschedule_task(task): + assert task not in ready + ready_append(task) task.state = 'READY' task.cancel_func = None @@ -404,6 +406,14 @@ class Kernel(object): suspend_task(state, lambda: unregister_event(fileobj, event)) # ---------------------------------------- + # Release any kernel resources associated with fileobj. + def trap_io_release(fileobj): + if current._last_io: + unregister_event(*current._last_io) + current._last_io = None + current._trap_result = None + + # ---------------------------------------- # Return tasks currently waiting on a file obj. def trap_io_waiting(fileobj): try: Index: curio-1.0/curio/traps.py =================================================================== --- curio-1.0.orig/curio/traps.py +++ curio-1.0/curio/traps.py @@ -13,7 +13,7 @@ __all__ = [ '_read_wait', '_write_wait', '_future_wait', '_sleep', '_spawn', '_cancel_task', '_scheduler_wait', '_scheduler_wake', '_get_kernel', '_get_current', '_set_timeout', '_unset_timeout', - '_clock', '_io_waiting', + '_clock', '_io_waiting', '_io_release', ] # -- Standard library @@ -50,6 +50,12 @@ async def _write_wait(fileobj): ''' return await _kernel_trap('trap_io', fileobj, EVENT_WRITE, 'WRITE_WAIT') +async def _io_release(fileobj): + ''' + Release kernel resources associated with a file + ''' + return await _kernel_trap('trap_io_release', fileobj) + async def _io_waiting(fileobj): ''' Return a tuple (rtask, wtask) of tasks currently blocked waiting Index: curio-1.0/docs/reference.rst =================================================================== --- curio-1.0.orig/docs/reference.rst +++ curio-1.0/docs/reference.rst @@ -1652,6 +1652,9 @@ may raise a cancellation exception. * - ``await _write_wait(fileobj)`` - Sleep until data can be written on *fileobj*. *fileobj* is any file-like object with a `fileno()` method. + * - ``await _io_release(fileobj)`` + Release any kernel resources associated with *fileobj*. Should + be called prior to closing any file. * - ``await _io_waiting(fileobj)`` - Returns a tuple `(rtask, wtask)` of tasks currently sleeping on *fileobj* (if any). Returns immediately.