From afb51114f4b834740c896086110e688078ff12e6 Mon Sep 17 00:00:00 2001 From: Jason Madden Date: Fri, 4 Dec 2020 10:52:07 -0600 Subject: [PATCH] Avoid printing a TypeError traceback on certain types of invalid client requests. Specifically, those that contain a spurious % in the request line. Test this, explicitly asserting both the returned status code and that we don't print a traceback. Fixes #1708. (cherry picked from commit 953bbe35ba1c5ab38a20caca6444bab748295d4d) --- CHANGES.rst | 1927 --------------------------------- docs/changes/1708.bugfix | 5 + src/gevent/pywsgi.py | 34 +- src/greentest/test__pywsgi.py | 19 +- 4 files changed, 45 insertions(+), 1940 deletions(-) delete mode 100644 CHANGES.rst create mode 100644 docs/changes/1708.bugfix diff --git a/CHANGES.rst b/CHANGES.rst deleted file mode 100644 index 90b84dc9..00000000 --- a/CHANGES.rst +++ /dev/null @@ -1,1927 +0,0 @@ -=========== - Changelog -=========== - -.. currentmodule:: gevent - -1.2.2 (2017-06-05) -================== - -- Testing on Python 3.5 now uses Python 3.5.3 due to SSL changes. See - :issue:`943`. -- Linux CI has been updated from Ubuntu 12.04 to Ubuntu 14.04 since - the former has reached EOL. -- Linux CI now tests on PyPy2 5.7.1, updated from PyPy2 5.6.0. -- Linux CI now tests on PyPy3 3.5-5.7.1-beta, updated from PyPy3 - 3.3-5.5-alpha. -- Python 2 sockets are compatible with the ``SOCK_CLOEXEC`` flag found - on Linux. They no longer pass the socket type or protocol to - ``getaddrinfo`` when ``connect`` is called. Reported in :issue:`944` - by Bernie Hackett. -- Replace ``optparse`` module with ``argparse``. See :issue:`947`. -- Update to version 1.3.1 of ``tblib`` to fix :issue:`954`, - reported by ml31415. -- Fix the name of the ``type`` parameter to - :func:`gevent.socket.getaddrinfo` to be correct on Python 3. This - would cause callers using keyword arguments to raise a :exc:`TypeError`. - Reported in :issue:`960` by js6626069. Likewise, correct the - argument names for ``fromfd`` and ``socketpair`` on Python 2, - although they cannot be called with keyword arguments under CPython. - - .. note:: The ``gethost*`` functions take different argument names - under CPython and PyPy. gevent follows the CPython - convention, although these functions cannot be called with - keyword arguments on CPython. -- The previously-singleton exception objects ``FileObjectClosed`` and - ``cancel_wait_ex`` were converted to classes. On Python 3, an - exception object is stateful, including references to its context - and possibly traceback, which could lead to objects remaining alive - longer than intended. -- Make sure that ``python -m gevent.monkey