python/cpython

Permalink

  1. bpo-40989: PyObject_INIT() becomes an alias to PyObject_Init() (GH-20901

    )
    
    The PyObject_INIT() and PyObject_INIT_VAR() macros become aliases to,
    respectively, PyObject_Init() and PyObject_InitVar() functions.
    
    Rename _PyObject_INIT() and _PyObject_INIT_VAR() static inline
    functions to, respectively, _PyObject_Init() and _PyObject_InitVar(),
    and move them to pycore_object.h. Remove their return value:
    their return type becomes void.
    
    The _datetime module is now built with the Py_BUILD_CORE_MODULE macro
    defined.
    
    Remove an outdated comment on _Py_tracemalloc_config.
  2. bpo-36020: Require vsnprintf() to build Python (GH-20899)

    The C99 functions snprintf() and vsnprintf() are now required
    to build Python.
    
    PyOS_snprintf() and PyOS_vsnprintf() no longer call Py_FatalError().
    Previously, they called Py_FatalError() on a buffer overflow on platforms
    which don't provide vsnprintf().
  3. bpo-36020: Remove snprintf macro in pyerrors.h (GH-20889)

    On Windows, #include "pyerrors.h" no longer defines "snprintf" and
    "vsnprintf" macros.
    
    PyOS_snprintf() and PyOS_vsnprintf() should be used to get portable
    behavior.
    
    Replace snprintf() calls with PyOS_snprintf() and replace vsnprintf()
    calls with PyOS_vsnprintf().
  4. bpo-40448: ensurepip: Do not use cache (GH-19812)

    ensurepip optionally installs or upgrades 'pip' and 'setuptools' using
    the version of those modules bundled with Python.  The internal PIP
    installation routine by default temporarily uses its cache, if it
    exists.  This is undesirable as Python builds and installations may be
    independent of the user running the build, whilst PIP cache location
    is dependent on the user's environment and outside of the build
    environment.
    
    At the same time, there's no value in using the cache while installing
    bundled modules.
    
    This change disables PIP caching when used in ensurepip.
  5. bpo-34226: fix cgi.parse_multipart without content_length (GH-8530)

    In Python 3.7 the behavior of parse_multipart changed requiring CONTENT-LENGTH
    header, this fix remove this header as required and fix FieldStorage
    read_lines_to_outerboundary, by not using limit when it's negative,
    since by default it's -1 if not content-length and keeps substracting what
    was read from the file object.
    
    Also added a test case for this problem.
  6. bpo-29782: Consolidate _Py_Bit_Length() (GH-20739)

    In GH-2866, _Py_Bit_Length() was added to pymath.h for lack of a better
    location. GH-20518 added a more appropriate header file for bit utilities. It
    also shows how to properly use intrinsics. This allows reconsidering bpo-29782.
    
    * Move the function to the new header.
    * Changed return type to match __builtin_clzl() and reviewed usage.
    * Use intrinsics where available.
    * Pick a fallback implementation suitable for inlining.
  1. bpo-40955: Fix memory leak in subprocess module (GH-20825)

    ```
    Direct leak of 8 byte(s) in 1 object(s) allocated from:
        #0 0x7f008bf19667 in __interceptor_malloc (/lib64/libasan.so.6+0xb0667)
        #1 0x7f007a0bee4a in subprocess_fork_exec /home/heimes/dev/python/cpython/Modules/_posixsubprocess.c:774
        #2 0xe0305b in cfunction_call Objects/methodobject.c:546
    ```
    
    Signed-off-by: Christian Heimes <christian@python.org>