Script 'mail_helper' called by obssrc Hello community, here is the log from the commit of package python-gevent for openSUSE:Factory checked in at 2023-05-19 11:55:21 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-gevent (Old) and /work/SRC/openSUSE:Factory/.python-gevent.new.1533 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-gevent" Fri May 19 11:55:21 2023 rev:41 rq:1087248 version:22.10.2 Changes: -------- --- /work/SRC/openSUSE:Factory/python-gevent/python-gevent.changes 2023-04-22 22:01:39.741647601 +0200 +++ /work/SRC/openSUSE:Factory/.python-gevent.new.1533/python-gevent.changes 2023-05-19 11:55:52.787386210 +0200 @@ -1,0 +2,27 @@ +Mon May 15 14:18:03 UTC 2023 - Steve Kowalik <steven.kowa...@suse.com> + +- Add patch handle-python-ssl-changes.patch: + * Handle Python 3.10 changes where ssl.shared_ciphers() changes + behaviour. + +------------------------------------------------------------------- +Mon May 15 13:44:48 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- skip one more test from testsuite + +------------------------------------------------------------------- +Thu May 4 20:28:36 UTC 2023 - Dirk Müller <dmuel...@suse.com> + +- update to 22.10.2: + * Update to greenlet 2.0. This fixes a deallocation issue that + required a change in greenlet's ABI. The design of greenlet 2.0 is + intended to prevent future fixes and enhancements from + requiring an ABI change, making it easier to update gevent + and greenlet independently. + +------------------------------------------------------------------- +Sun Apr 23 23:15:24 UTC 2023 - Matej Cepl <mc...@suse.com> + +- Switch documentation to be within the main package. + +------------------------------------------------------------------- Old: ---- gevent-22.10.1.tar.gz New: ---- gevent-22.10.2.tar.gz handle-python-ssl-changes.patch ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-gevent.spec ++++++ --- /var/tmp/diff_new_pack.Trkde9/_old 2023-05-19 11:55:53.599390853 +0200 +++ /var/tmp/diff_new_pack.Trkde9/_new 2023-05-19 11:55:53.599390853 +0200 @@ -25,7 +25,7 @@ %endif %{?sle15_python_module_pythons} Name: python-gevent -Version: 22.10.1 +Version: 22.10.2 Release: 0 Summary: Python network library that uses greenlet and libevent License: MIT @@ -39,11 +39,12 @@ # let's selectively disable the warning around the offending code Patch0: fix-no-return-in-nonvoid-function.patch Patch1: skip-tests-in-leap.patch +Patch2: handle-python-ssl-changes.patch BuildRequires: %{python_module Cython} BuildRequires: %{python_module cffi} BuildRequires: %{python_module devel} BuildRequires: %{python_module dnspython} -BuildRequires: %{python_module greenlet >= 1.1.0} +BuildRequires: %{python_module greenlet >= 2.0.0} BuildRequires: %{python_module objgraph} BuildRequires: %{python_module psutil} BuildRequires: %{python_module requests} @@ -60,7 +61,7 @@ BuildRequires: pkgconfig(libuv) Requires: python-cffi Requires: python-dnspython -Requires: python-greenlet +Requires: python-greenlet >= 2.0.0 Requires: python-requests Requires: python-zope.event Requires: python-zope.interface @@ -91,6 +92,7 @@ implementation and better performance. Read why others use gevent and check out the list of the open source projects based on gevent. +%if 0%{?suse_version} > 1500 %package -n python-gevent-doc Summary: Documentation for %{name} Group: Documentation/Other @@ -99,6 +101,7 @@ %description -n python-gevent-doc Documentation and examples for %{name}. +%endif %prep %setup -q -n gevent-%{version} @@ -109,6 +112,9 @@ %if 0%{?sle_version} <= 150300 %patch1 -p1 %endif +%if 0%{?is_opensuse} +%patch2 -p1 +%endif sed -i -e '1s!bin/env python!bin/python!' examples/*.py sed -i -e '1{/bin.*python/d}' src/gevent/tests/*.py @@ -145,6 +151,7 @@ test__getaddrinfo_import.py test__resolver_dnspython.py test__socket_dns.py +test__issue1686.py EOF if [ %{$python_version_nodots} -lt 37 ]; then echo "test__threading_2.py" >> skip_tests.txt @@ -172,8 +179,10 @@ %{python_sitearch}/gevent-%{version}*-info %{python_sitearch}/gevent +%if 0%{?suse_version} > 1500 %files -n python-gevent-doc %license LICENSE* +%endif %doc examples/ %changelog ++++++ gevent-22.10.1.tar.gz -> gevent-22.10.2.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/.github/workflows/ci.yml new/gevent-22.10.2/.github/workflows/ci.yml --- old/gevent-22.10.1/.github/workflows/ci.yml 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/.github/workflows/ci.yml 2022-10-31 19:53:13.000000000 +0100 @@ -83,7 +83,7 @@ # 3.10 needs more work: dnspython for example doesn't work # with it. That means for the bulk of our testing we need to # stick to 3.9. - python-version: [2.7, pypy-2.7, pypy-3.7, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11.0-rc.2'] + python-version: [2.7, pypy-2.7, pypy-3.7, 3.6, 3.7, 3.8, 3.9, '3.10', '3.11'] # ubuntu-latest is at least 20.04. But this breaks the SSL # tests because Ubuntu increased the default OpenSSL # strictness. @@ -97,6 +97,13 @@ python-version: pypy-3.7 - os: macos-latest python-version: 3.6 + - os: macos-latest + python-version: 3.7 + - os: macos-latest + python-version: 3.8 + - os: macos-latest + python-version: 3.9 + - os: ubuntu-latest python-version: 2.7 - os: ubuntu-latest @@ -107,6 +114,7 @@ python-version: 3.6 - os: ubuntu-latest python-version: 3.7 + - os: ubuntu-18.04 python-version: 3.8 - os: ubuntu-18.04 @@ -114,7 +122,7 @@ - os: ubuntu-18.04 python-version: '3.10' - os: ubuntu-18.04 - python-version: '3.11.0-rc.2' + python-version: '3.11' steps: - name: checkout uses: actions/checkout@v2 @@ -198,7 +206,7 @@ pip install -q -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' pip install -q -U 'cffi;platform_python_implementation=="CPython"' pip install -q -U 'cython>=3.0a9' - pip install 'greenlet>=1.0a1,<2;platform_python_implementation=="CPython"' + pip install 'greenlet>=2.0.0 ;platform_python_implementation=="CPython"' - name: Build gevent run: | @@ -393,7 +401,7 @@ pip install -q -U 'faulthandler; python_version == "2.7" and platform_python_implementation == "CPython"' pip install -q -U 'cffi;platform_python_implementation=="CPython"' pip install -q -U 'cython>=3.0a5' - pip install 'greenlet>=1.0a1,<2;platform_python_implementation=="CPython"' + pip install 'greenlet>=2.0.0; platform_python_implementation=="CPython"' - name: build libs and gevent env: @@ -434,11 +442,20 @@ linux_wheels: runs-on: ubuntu-latest + # If we have 'needs: test', then these wait to start running until + # all the test matrix passes. That's good, because these take a + # long time, and they take a long time to kill if something goes + # wrong. OTOH, if one of the tests fail, and this is a release tag, + # we have to notice that and try restarting things so that the + # wheels get built and uploaded. For that reason, it's simplest to + # remove this for release branches. + #needs: test strategy: matrix: config: # Python version, docker image, short name - - ["3.9", "quay.io/pypa/manylinux2010_x86_64", "manylinux"] + - ["3.9", "quay.io/pypa/manylinux2010_x86_64:2021-02-06-3d322a5", "manylinux"] + - ["3.9", "quay.io/pypa/manylinux2014_x86_64", "manylinux2014"] - ["3.9", "quay.io/pypa/musllinux_1_1_x86_64", "musllinux"] - ["3.9", "quay.io/pypa/manylinux2014_aarch64", "manylinux_aarch64"] - ["3.9", "quay.io/pypa/manylinux2014_ppc64le", "manylinux_ppc64le"] @@ -486,7 +503,8 @@ # The 2010 image is the last one that comes with Python 2.7, # and only up through the tag 2021-02-06-3d322a5. # Unfortunately, this does not include Python 3.10, and the - # images that include Python 3.10 don't have 2.7. Sigh. + # images that include Python 3.10 don't have 2.7. Sigh. So + # we get 2.7 from 2010, and 3.10 from 2014. env: DOCKER_IMAGE: ${{ matrix.config[1] }} GEVENT_MANYLINUX_NAME: ${{ matrix.config[2] }} diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/CHANGES.rst new/gevent-22.10.2/CHANGES.rst --- old/gevent-22.10.1/CHANGES.rst 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/CHANGES.rst 2022-10-31 19:53:13.000000000 +0100 @@ -6,6 +6,28 @@ .. towncrier release notes start +22.10.2 (2022-10-31) +==================== + + +Bugfixes +-------- + +- Update to greenlet 2.0. This fixes a deallocation issue that required + a change in greenlet's ABI. The design of greenlet 2.0 is intended to + prevent future fixes and enhancements from requiring an ABI change, + making it easier to update gevent and greenlet independently. + + .. caution:: + + greenlet 2.0 requires a modern-ish C++ compiler. This may mean + certain older platforms are no longer supported. + See :issue:`1909`. + + +---- + + 22.10.1 (2022-10-14) ==================== diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/appveyor.yml new/gevent-22.10.2/appveyor.yml --- old/gevent-22.10.1/appveyor.yml 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/appveyor.yml 2022-10-31 19:53:13.000000000 +0100 @@ -46,6 +46,12 @@ # a later point release. # 64-bit + - PYTHON: "C:\\Python311-x64" + PYTHON_VERSION: "3.11.0" + PYTHON_ARCH: "64" + PYTHON_EXE: python + APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 + - PYTHON: "C:\\pypy3.7-v7.3.7-win64" PYTHON_ID: "pypy3" PYTHON_EXE: pypy3w @@ -81,10 +87,6 @@ PYTHON_EXE: python APPVEYOR_BUILD_WORKER_IMAGE: Visual Studio 2019 - - PYTHON: "C:\\Python27-x64" - PYTHON_VERSION: "2.7.x" # currently 2.7.13 - PYTHON_ARCH: "64" - PYTHON_EXE: python - PYTHON: "C:\\Python38-x64" PYTHON_VERSION: "3.8.x" @@ -138,6 +140,20 @@ PYTHON_EXE: python GWHEEL_ONLY: true + - PYTHON: "C:\\Python27-x64" + PYTHON_VERSION: "2.7.x" # currently 2.7.13 + PYTHON_ARCH: "64" + PYTHON_EXE: python + # greenlet 2.0 is evincing a warning (probably?) + # on shutdown, leading to the dreaded error: + # Fatal Python error: PyImport_GetModuleDict: no module + # dictionary! + # in some tests. This is hard to debug remotely, and as support + # for 2.7 is winding down quickly (hey, we're only two years + # late to the party) I'm not specifically going to try to debug + # it. We'll just provide a binary wheel still. + GWHEEL_ONLY: true + # Also test a Python version not pre-installed # See: https://github.com/ogrisel/python-appveyor-demo/issues/10 diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/deps/greenlet/greenlet.h new/gevent-22.10.2/deps/greenlet/greenlet.h --- old/gevent-22.10.1/deps/greenlet/greenlet.h 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/deps/greenlet/greenlet.h 2022-10-31 19:53:13.000000000 +0100 @@ -5,6 +5,7 @@ #ifndef Py_GREENLETOBJECT_H #define Py_GREENLETOBJECT_H + #include <Python.h> #ifdef __cplusplus @@ -14,60 +15,24 @@ /* This is deprecated and undocumented. It does not change. */ #define GREENLET_VERSION "1.0.0" -#if PY_VERSION_HEX >= 0x30B00A6 -# define GREENLET_PY311 1 - /* _PyInterpreterFrame moved to the internal C API in Python 3.11 */ -# include <internal/pycore_frame.h> -#else -# define GREENLET_PY311 0 -# define _PyCFrame CFrame +#ifndef GREENLET_MODULE +#define implementation_ptr_t void* #endif typedef struct _greenlet { PyObject_HEAD - char* stack_start; - char* stack_stop; - char* stack_copy; - intptr_t stack_saved; - struct _greenlet* stack_prev; - struct _greenlet* parent; - PyObject* run_info; - struct _frame* top_frame; - int recursion_depth; -#if GREENLET_PY311 - _PyInterpreterFrame *current_frame; - _PyStackChunk *datastack_chunk; - PyObject **datastack_top; - PyObject **datastack_limit; -#endif PyObject* weakreflist; -#if PY_VERSION_HEX >= 0x030700A3 - _PyErr_StackItem* exc_info; - _PyErr_StackItem exc_state; -#else - PyObject* exc_type; - PyObject* exc_value; - PyObject* exc_traceback; -#endif PyObject* dict; -#if PY_VERSION_HEX >= 0x030700A3 - PyObject* context; -#endif -#if PY_VERSION_HEX >= 0x30A00B1 - _PyCFrame* cframe; -#endif + implementation_ptr_t pimpl; } PyGreenlet; -#define PyGreenlet_Check(op) PyObject_TypeCheck(op, &PyGreenlet_Type) -#define PyGreenlet_MAIN(op) (((PyGreenlet*)(op))->stack_stop == (char*)-1) -#define PyGreenlet_STARTED(op) (((PyGreenlet*)(op))->stack_stop != NULL) -#define PyGreenlet_ACTIVE(op) (((PyGreenlet*)(op))->stack_start != NULL) -#define PyGreenlet_GET_PARENT(op) (((PyGreenlet*)(op))->parent) +#define PyGreenlet_Check(op) (op && PyObject_TypeCheck(op, &PyGreenlet_Type)) + /* C API functions */ /* Total number of symbols that are exported */ -#define PyGreenlet_API_pointers 8 +#define PyGreenlet_API_pointers 12 #define PyGreenlet_Type_NUM 0 #define PyExc_GreenletError_NUM 1 @@ -79,6 +44,11 @@ #define PyGreenlet_Switch_NUM 6 #define PyGreenlet_SetParent_NUM 7 +#define PyGreenlet_MAIN_NUM 8 +#define PyGreenlet_STARTED_NUM 9 +#define PyGreenlet_ACTIVE_NUM 10 +#define PyGreenlet_GET_PARENT_NUM 11 + #ifndef GREENLET_MODULE /* This section is used by modules that uses the greenlet C API */ static void** _PyGreenlet_API = NULL; @@ -144,6 +114,39 @@ (*(int (*)(PyGreenlet * greenlet, PyGreenlet * nparent)) \ _PyGreenlet_API[PyGreenlet_SetParent_NUM]) +/* + * PyGreenlet_GetParent(PyObject* greenlet) + * + * return greenlet.parent; + * + * This could return NULL even if there is no exception active. + * If it does not return NULL, you are responsible for decrementing the + * reference count. + */ +# define PyGreenlet_GetParent \ + (*(PyGreenlet* (*)(PyGreenlet*)) \ + _PyGreenlet_API[PyGreenlet_GET_PARENT_NUM]) + +/* + * deprecated, undocumented alias. + */ +# define PyGreenlet_GET_PARENT PyGreenlet_GetParent + +# define PyGreenlet_MAIN \ + (*(int (*)(PyGreenlet*)) \ + _PyGreenlet_API[PyGreenlet_MAIN_NUM]) + +# define PyGreenlet_STARTED \ + (*(int (*)(PyGreenlet*)) \ + _PyGreenlet_API[PyGreenlet_STARTED_NUM]) + +# define PyGreenlet_ACTIVE \ + (*(int (*)(PyGreenlet*)) \ + _PyGreenlet_API[PyGreenlet_ACTIVE_NUM]) + + + + /* Macro that imports greenlet and initializes C API */ /* NOTE: This has actually moved to ``greenlet._greenlet._C_API``, but we keep the older definition to be sure older code that might have a copy of diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/pyproject.toml new/gevent-22.10.2/pyproject.toml --- old/gevent-22.10.1/pyproject.toml 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/pyproject.toml 2022-10-31 19:53:13.000000000 +0100 @@ -23,8 +23,10 @@ # Python 3.7 requires at least 0.4.14, which is ABI incompatible with earlier # releases. Python 3.9 and 3.10 require 0.4.16; # 0.4.17 is ABI incompatible with earlier releases, but compatible with 1.0 - # 1.1.3 is needed for CPython 3.11 - "greenlet >= 1.1.3, < 2.0 ; platform_python_implementation == 'CPython'", + # 1.1.3 is needed for CPython 3.11. + # 2.0 is not ABI compatible with earlier releases, but with luck it won't + # have to break the ABI again. + "greenlet >= 2.0.0 ; platform_python_implementation == 'CPython'", ] [tool.towncrier] diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/scripts/releases/make-manylinux new/gevent-22.10.2/scripts/releases/make-manylinux --- old/gevent-22.10.1/scripts/releases/make-manylinux 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/scripts/releases/make-manylinux 2022-10-31 19:53:13.000000000 +0100 @@ -125,7 +125,7 @@ # The downside is that we must install dependencies manually. # NOTE: We can't upgrade ``wheel`` because ``auditwheel`` depends on # it, and auditwheel is installed in one of these environments. - python -mpip install -U "cython >= 3.0a6" cffi 'greenlet >= 1.0' setuptools + python -mpip install -U "cython >= 3.0a6" cffi 'greenlet >= 2.0.0' setuptools time (python setup.py bdist_wheel) PATH="$OPATH" auditwheel repair dist/gevent*.whl cp wheelhouse/gevent*.whl /gevent/wheelhouse diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/setup.py new/gevent-22.10.2/setup.py --- old/gevent-22.10.1/setup.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/setup.py 2022-10-31 19:53:13.000000000 +0100 @@ -213,7 +213,9 @@ # so we can add an upper bound). # 1.1.0 is required for 3.10; it has a new ABI, but only on 1.1.0. # 1.1.3 is needed for 3.11, and supports everything 1.1.0 did. - 'greenlet >= 1.1.3, < 2.0; platform_python_implementation=="CPython"', + # 2.0.0 supports everything 1.1.3 did, but breaks the ABI in a way that hopefully + # won't break again. + 'greenlet >= 2.0.0 ; platform_python_implementation=="CPython"', ] # Note that we don't add cffi to install_requires, it's diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/__init__.py new/gevent-22.10.2/src/gevent/__init__.py --- old/gevent-22.10.1/src/gevent/__init__.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/__init__.py 2022-10-31 19:53:13.000000000 +0100 @@ -27,7 +27,7 @@ #: Use ``pkg_resources.parse_version(__version__)`` or #: ``packaging.version.Version(__version__)`` to get a machine-usable #: value. -__version__ = '22.10.1' +__version__ = '22.10.2' __all__ = [ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/_gevent_cgreenlet.pxd new/gevent-22.10.2/src/gevent/_gevent_cgreenlet.pxd --- old/gevent-22.10.1/src/gevent/_gevent_cgreenlet.pxd 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/_gevent_cgreenlet.pxd 2022-10-31 19:53:13.000000000 +0100 @@ -1,6 +1,8 @@ # cython: auto_pickle=False cimport cython +from cpython.ref cimport Py_DECREF + from gevent._gevent_c_ident cimport IdentRegistry from gevent._gevent_c_hub_local cimport get_hub_noargs as get_hub from gevent._gevent_c_waiter cimport Waiter @@ -21,12 +23,14 @@ # properly handle the case that it can be NULL. So instead we inline a getparent # function that does the same thing as the green_getparent accessor but without # going through the overhead of generic attribute lookup. - cdef void* parent + #cdef void* parent + pass # These are actually macros and so must be included # (defined) in each .pxd, as are the two functions # that call them. greenlet PyGreenlet_GetCurrent() + void* PyGreenlet_GetParent(greenlet) void PyGreenlet_Import() @cython.final @@ -36,13 +40,26 @@ cdef inline object get_generic_parent(greenlet s): # We don't use any typed functions on the return of this, # so save the type check by making it just an object. - if s.parent != NULL: - return <object>s.parent + cdef object result + cdef void* parent = PyGreenlet_GetParent(s) + if parent != NULL: + # The cast will perform an incref; but the GetParent + # function already did an incref if we got it (and not NULL). + # Therefore, we must DECREF immediately. + result = <object>parent + Py_DECREF(result) + return result cdef inline SwitchOutGreenletWithLoop get_my_hub(greenlet s): + # This one we do want type checked on the return value. # Must not be called with s = None - if s.parent != NULL: - return <object>s.parent + cdef object result + cdef void* parent = PyGreenlet_GetParent(s) + if parent != NULL: + result = <object>parent + # See above + Py_DECREF(result) + return result cdef bint _greenlet_imported diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/subprocess.py new/gevent-22.10.2/src/gevent/subprocess.py --- old/gevent-22.10.1/src/gevent/subprocess.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/subprocess.py 2022-10-31 19:53:13.000000000 +0100 @@ -224,6 +224,7 @@ _fork_exec = None __implements__.extend([ '_fork_exec', + ] if sys.platform != 'win32' else [ ]) actually_imported = copy_globals(__subprocess__, globals(), diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/tests/test__memleak.py new/gevent-22.10.2/src/gevent/tests/test__memleak.py --- old/gevent-22.10.1/src/gevent/tests/test__memleak.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/tests/test__memleak.py 2022-10-31 19:53:13.000000000 +0100 @@ -26,6 +26,16 @@ refcounts.append(sys.gettotalrefcount()) # Refcounts may go down, but not up + # XXX: JAM: I think this may just be broken. Each time we add + # a new integer to our list of refcounts, we'll be + # creating a new reference. This makes sense when we see the list + # go up by one each iteration: + # + # AssertionError: 530631 not less than or equal to 530630 + # : total refcount mismatch: + # [530381, 530618, 530619, 530620, 530621, + # 530622, 530623, 530624, 530625, 530626, + # 530627, 530628, 530629, 530630, 530631] final = refcounts[-1] previous = refcounts[-2] self.assertLessEqual( diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/tests/test__socket_dns.py new/gevent-22.10.2/src/gevent/tests/test__socket_dns.py --- old/gevent-22.10.1/src/gevent/tests/test__socket_dns.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/tests/test__socket_dns.py 2022-10-31 19:53:13.000000000 +0100 @@ -34,6 +34,7 @@ from gevent.testing.sysinfo import RESOLVER_ARES from gevent.testing.sysinfo import PY2 from gevent.testing.sysinfo import PYPY + import gevent.testing.timing @@ -45,7 +46,8 @@ def add(klass, hostname, name=None, - skip=None, skip_reason=None): + skip=None, skip_reason=None, + require_equal_errors=True): call = callable(hostname) @@ -64,33 +66,39 @@ def test_getaddrinfo_http(self): x = hostname() if call else hostname - self._test('getaddrinfo', x, 'http') + self._test('getaddrinfo', x, 'http', + require_equal_errors=require_equal_errors) test_getaddrinfo_http.__name__ = 'test_%s_getaddrinfo_http' % name _setattr(klass, test_getaddrinfo_http.__name__, test_getaddrinfo_http) def test_gethostbyname(self): x = hostname() if call else hostname - ipaddr = self._test('gethostbyname', x) + ipaddr = self._test('gethostbyname', x, + require_equal_errors=require_equal_errors) if not isinstance(ipaddr, Exception): - self._test('gethostbyaddr', ipaddr) + self._test('gethostbyaddr', ipaddr, + require_equal_errors=require_equal_errors) test_gethostbyname.__name__ = 'test_%s_gethostbyname' % name _setattr(klass, test_gethostbyname.__name__, test_gethostbyname) - def test3(self): + def test_gethostbyname_ex(self): x = hostname() if call else hostname - self._test('gethostbyname_ex', x) - test3.__name__ = 'test_%s_gethostbyname_ex' % name - _setattr(klass, test3.__name__, test3) + self._test('gethostbyname_ex', x, + require_equal_errors=require_equal_errors) + test_gethostbyname_ex.__name__ = 'test_%s_gethostbyname_ex' % name + _setattr(klass, test_gethostbyname_ex.__name__, test_gethostbyname_ex) def test4(self): x = hostname() if call else hostname - self._test('gethostbyaddr', x) + self._test('gethostbyaddr', x, + require_equal_errors=require_equal_errors) test4.__name__ = 'test_%s_gethostbyaddr' % name _setattr(klass, test4.__name__, test4) def test5(self): x = hostname() if call else hostname - self._test('getnameinfo', (x, 80), 0) + self._test('getnameinfo', (x, 80), 0, + require_equal_errors=require_equal_errors) test5.__name__ = 'test_%s_getnameinfo' % name _setattr(klass, test5.__name__, test5) @@ -187,17 +195,20 @@ return type(result1) is not type(result2) return repr(result1) != repr(result2) - def _test(self, func_name, *args): + def _test(self, func_name, *args, **kwargs): """ Runs the function *func_name* with *args* and compares gevent and the system. + Keyword arguments are passed to the function itself; variable args are + used for the socket function. + Returns the gevent result. """ gevent_func = getattr(gevent_socket, func_name) real_func = monkey.get_original('socket', func_name) tester = getattr(self, '_run_test_' + func_name, self._run_test_generic) - result = tester(func_name, real_func, gevent_func, args) + result = tester(func_name, real_func, gevent_func, args, **kwargs) _real_result, time_real, gevent_result, time_gevent = result if self.verbose_dns and time_gevent > time_real + 0.02 and time_gevent > 0.03: @@ -213,14 +224,17 @@ return gevent_result - def _run_test_generic(self, func_name, real_func, gevent_func, func_args): + def _run_test_generic(self, func_name, real_func, gevent_func, func_args, + require_equal_errors=True): real_result, time_real = self.run_resolver(real_func, func_args) gevent_result, time_gevent = self.run_resolver(gevent_func, func_args) if util.QUIET and self.should_log_results(real_result, gevent_result): util.log('') self.__trace_call(real_result, time_real, real_func, func_args) self.__trace_call(gevent_result, time_gevent, gevent_func, func_args) - self.assertEqualResults(real_result, gevent_result, func_name) + + self.assertEqualResults(real_result, gevent_result, func_name, + require_equal_errors=require_equal_errors) return real_result, time_real, gevent_result, time_gevent def _normalize_result(self, result, func_name): @@ -411,7 +425,8 @@ # As for getaddrinfo, we'll just check the ipaddrlist has something in common. return not set(real_result[2]).isdisjoint(set(gevent_result[2])) - def assertEqualResults(self, real_result, gevent_result, func_name): + def assertEqualResults(self, real_result, gevent_result, func_name, + require_equal_errors=True): errors = ( OverflowError, TypeError, @@ -421,7 +436,8 @@ socket.herror, ) if isinstance(real_result, errors) and isinstance(gevent_result, errors): - self._compare_exceptions(real_result, gevent_result, func_name) + if require_equal_errors: + self._compare_exceptions(real_result, gevent_result, func_name) return real_result = self._normalize_result(real_result, func_name) @@ -769,10 +785,22 @@ # the 2008 version of idna encoding, whereas on Python 2, # with the default resolver, it tries to encode to ascii and # raises a UnicodeEncodeError. So we get different results. + +# Starting 20221027, on GitHub Actions and *some* versions of Python, +# we started getting a different error result from our own resolver +# compared to the system. This is very weird because our own resolver +# calls the system. I can't reproduce locally. Perhaps the two +# different answers are because of caching? One from the real DNS +# server, one from the local resolver library? Hence +# require_equal_errors=False +# ('system:', "herror(2, 'Host name lookup failure')", +# 'gevent:', "herror(1, 'Unknown host')") add(TestInternational, u'пÑезиденÑ.ÑÑ', 'russian', skip=(PY2 and RESOLVER_DNSPYTHON), - skip_reason="dnspython can actually resolve these") -add(TestInternational, u'пÑезиденÑ.ÑÑ'.encode('idna'), 'idna') + skip_reason="dnspython can actually resolve these", + require_equal_errors=False) +add(TestInternational, u'пÑезиденÑ.ÑÑ'.encode('idna'), 'idna', + require_equal_errors=False) @skipWithoutExternalNetwork("Tries to resolve and compare hostnames/addrinfo") class TestInterrupted_gethostbyname(gevent.testing.timing.AbstractGenericWaitTestCase): diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/gevent-22.10.1/src/gevent/tests/test__socket_dns6.py new/gevent-22.10.2/src/gevent/tests/test__socket_dns6.py --- old/gevent-22.10.1/src/gevent/tests/test__socket_dns6.py 2022-10-14 22:52:50.000000000 +0200 +++ new/gevent-22.10.2/src/gevent/tests/test__socket_dns6.py 2022-10-31 19:53:13.000000000 +0100 @@ -61,10 +61,10 @@ if not OSX and RESOLVER_DNSPYTHON: # It raises gaierror instead of socket.error, # which is not great and leads to failures. - def _run_test_getnameinfo(self, *_args): + def _run_test_getnameinfo(self, *_args, **_kwargs): return (), 0, (), 0 - def _run_test_gethostbyname(self, *_args): + def _run_test_gethostbyname(self, *_args, **_kwargs): raise unittest.SkipTest("gethostbyname[_ex] does not support IPV6") _run_test_gethostbyname_ex = _run_test_gethostbyname ++++++ handle-python-ssl-changes.patch ++++++ Index: gevent-22.10.2/src/greentest/3.10/test_ssl.py =================================================================== --- gevent-22.10.2.orig/src/greentest/3.10/test_ssl.py +++ gevent-22.10.2/src/greentest/3.10/test_ssl.py @@ -2306,13 +2306,19 @@ class SimpleBackgroundTests(unittest.Tes self.assertIs(sslobj._sslobj.owner, sslobj) self.assertIsNone(sslobj.cipher()) self.assertIsNone(sslobj.version()) - self.assertIsNotNone(sslobj.shared_ciphers()) + try: + self.assertIsNotNone(sslobj.shared_ciphers()) + except AssertionError: + self.assertIsNone(sslobj.shared_ciphers()) self.assertRaises(ValueError, sslobj.getpeercert) if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: self.assertIsNone(sslobj.get_channel_binding('tls-unique')) self.ssl_io_loop(sock, incoming, outgoing, sslobj.do_handshake) self.assertTrue(sslobj.cipher()) - self.assertIsNotNone(sslobj.shared_ciphers()) + try: + self.assertIsNotNone(sslobj.shared_ciphers()) + except AssertionError: + self.assertIsNone(sslobj.shared_ciphers()) self.assertIsNotNone(sslobj.version()) self.assertTrue(sslobj.getpeercert()) if 'tls-unique' in ssl.CHANNEL_BINDING_TYPES: