Commit Graph

10844 Commits

Author SHA1 Message Date
Stefan Krah 22faf6ad3b
[3.7] Revert bpo-39576: Prevent memory error for overly optimistic precisions (GH-20748)
This reverts commit c6f95543b4.
2020-06-09 01:55:47 +02:00
Miss Islington (bot) 296db8cc2f
bpo-30008: Fix OpenSSL no-deprecated compilation (GH-20397)
Fix :mod:`ssl`` code to be compatible with OpenSSL 1.1.x builds that use
``no-deprecated`` and ``--api=1.1.0``.

Note: Tests assume full OpenSSL API and fail with limited API.

Signed-off-by: Christian Heimes <christian@python.org>
Co-authored-by: Mark Wright <gienah@gentoo.org>
(cherry picked from commit a871f692b4)

Co-authored-by: Christian Heimes <christian@python.org>
2020-06-01 00:11:51 -07:00
Miss Islington (bot) 1c4dcafd0b
bpo-13097: ctypes: limit callback to 1024 arguments (GH-19914)
ctypes now raises an ArgumentError when a callback
is invoked with more than 1024 arguments.

The ctypes module allocates arguments on the stack in
ctypes_callproc() using alloca(), which is problematic
when large numbers of arguments are passed. Instead
of a stack overflow, this commit raises an ArgumentError
if more than 1024 parameters are passed.
(cherry picked from commit 29a1384c04)

Co-authored-by: Sean Gillespie <sean@swgillespie.me>
2020-05-27 08:51:23 -07:00
Tal Einat 3f215f35bd
[3.7] bpo-38580: Document that select() accepts iterables, not just sequences (GH-16832)
(cherry picked from commit 372ee27d49)

Co-authored-by: Jakub Stasiak <jakub@stasiak.at>
2020-05-26 15:59:23 +03:00
Miss Islington (bot) 4ea8028684
[3.8] bpo-35714: Reject null characters in struct format strings (GH-16928) (GH-20419)
struct.error is now raised if there is a null character in a struct
format string.
(cherry picked from commit 3f59b55316)
(cherry picked from commit 5ff5edfef6)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-05-26 02:16:36 -07:00
Miss Islington (bot) 6da26f8cec
bpo-40653: Move _dirnameW out of GH-ifdef HAVE_SYMLINK/GH-endif (GH-20144)
(cherry picked from commit 7f21c9ac87)

Co-authored-by: Minmin Gong <gongminmin@msn.com>
2020-05-18 09:34:21 -07:00
Miss Islington (bot) 43b355e53f
[3.7] bpo-40457: Support OpenSSL without TLS 1.0/1.1 (GH-19862) (GH-20126) 2020-05-16 10:45:06 +02:00
Christian Heimes efc9065904 [3.7] bpo-40515: Require OPENSSL_THREADS (GH-19953) (GH-20120) 2020-05-15 22:37:32 +02:00
Miss Islington (bot) 2501428988
[3.7] bpo-40559: Add Py_DECREF to _asynciomodule.c:task_step_impl() (GH-19990)
This fixes a possible memory leak in the C implementation of
asyncio.Task.
(cherry picked from commit d2c349b190)

Co-authored-by: Chris Jerdonek <chris.jerdonek@gmail.com>
2020-05-08 04:30:30 -07:00
Miss Islington (bot) de5dcfa3bc
bpo-40138: Fix Windows os.waitpid() for large exit code (GH-19654)
Fix the Windows implementation of os.waitpid() for exit code
larger than "INT_MAX >> 8". The exit status is now interpreted as an
unsigned number.
(cherry picked from commit b07350901c)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-04-22 09:16:42 -07:00
Serhiy Storchaka 67ae454da7
[3.7] bpo-40179: Fix translation of #elif in Argument Clinic (GH-19364) (GH-19584)
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
(cherry picked from commit 12446e6a60)
2020-04-18 19:12:14 +03:00
Miss Islington (bot) 096e41aa4e
[3.7] bpo-31758: Prevent crashes when using an uninitialized _elementtree.XMLParser object (GH-3997) (GH-19487)
(cherry picked from commit 402e1cdb13)
2020-04-12 19:15:35 +02:00
Miss Islington (bot) 0f9e889cd9
bpo-39689: Do not use native packing for format "?" with standard size (GH-18969)
(cherry picked from commit 472fc843ca)

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-03-31 05:24:07 -07:00
Miss Islington (bot) 5753fc6997
bpo-40014: Fix os.getgrouplist() (GH-19126)
Fix os.getgrouplist(): if getgrouplist() function fails because the
group list is too small, retry with a larger group list.

On failure, the glibc implementation of getgrouplist() sets ngroups
to the total number of groups. For other implementations, double the
group list size.
(cherry picked from commit f5c7cabb2b)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-24 10:39:15 -07:00
Miss Islington (bot) 1cdc61c767
bpo-40014: Fix os.getgrouplist() on macOS (GH-19118)
On macOS, getgrouplist() returns a non-zero value without setting
errno if the group list is too small. Double the list size and call
it again in this case.
(cherry picked from commit 8ec7370c89)

Co-authored-by: Victor Stinner <vstinner@python.org>
2020-03-23 12:21:07 -07:00
Jason R. Coombs 5765acaf64
[3.7] bpo-22490: Remove __PYVENV_LAUNCHER__ from environment during launch (GH-9516) (GH-19111)
* bpo-22490: Remove "__PYVENV_LAUNCHER__" from the shell environment on macOS

This changeset removes the environment varialbe "__PYVENV_LAUNCHER__"
during interpreter launch as it is only needed to communicate between
the stub executable in framework installs and the actual interpreter.

Leaving the environment variable present may lead to misbehaviour when
launching other scripts.

* Actually commit the changes for issue 22490...

* Correct typo

Co-Authored-By: Nicola Soranzo <nicola.soranzo@gmail.com>

* Run make patchcheck

Co-authored-by: Jason R. Coombs <jaraco@jaraco.com>
Co-authored-by: Nicola Soranzo <nicola.soranzo@gmail.com>.
(cherry picked from commit 044cf94f61)

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>

Co-authored-by: Ronald Oussoren <ronaldoussoren@mac.com>
2020-03-22 15:25:20 -04:00
Serhiy Storchaka 39680fb704
[3.7] bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942). (GH-19104)
(cherry picked from commit b146568dfc)
2020-03-21 16:33:44 +02:00
Miss Islington (bot) 148786a2cd
bpo-39582: ossaudiodev module update helpers signature for ioctl calls. (GH-18412)
(cherry picked from commit b81f40f0ad)

Co-authored-by: David CARLIER <devnexen@gmail.com>
2020-03-14 07:43:47 -07:00
Mark Dickinson 4dcfe5f2e4
[3.7] bpo-39871: Fix possible SystemError in atan2, copysign and remainder (GH-18806) (GH-18990)
In math_2(), the first PyFloat_AsDouble() call should be checked
for failure before the second call.

Co-authored-by: Mark Dickinson <dickinsm@gmail.com>.
(cherry picked from commit 5208b4b379)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2020-03-14 11:51:53 +00:00
Serhiy Storchaka 6f4e7fcfca
[3.7] bpo-38643: Raise SystemError instead of crashing when PyNumber_ToBase is called with invalid base. (GH-18863). (GH-18955)
(cherry picked from commit e5ccc94bbb)
2020-03-12 10:15:17 +02:00
Miss Islington (bot) 80be9c344f
bpo-39903: Fix double decref in _elementtree.Element.__getstate__ (GH-18850)
(cherry picked from commit 88944a44aa)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2020-03-09 05:53:29 -07:00
Miss Islington (bot) d3c2435089
bpo-39378: partial of PickleState struct should be traversed. (GH-18046)
(cherry picked from commit 1f577ce363)

Co-authored-by: Hai Shi <shihai1992@gmail.com>
2020-03-01 22:46:59 -08:00
Stefan Krah c4ca1f8f24
[3.7] bpo-39794: Add --without-decimal-contextvar (GH-18702)
* bpo-39794: Add --without-decimal-contextvar (#18702)

(cherry picked from commit 815280eb16)
2020-02-29 23:10:26 +01:00
Pablo Galindo 333b9899fc
[3.7] bpo-39427: Document -X opt options in the CLI --help and the man page (GH-18131) (#18134)
https://bugs.python.org/issue39427

Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 41f0ef6abb)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-02-23 20:48:30 +00:00
Miss Islington (bot) c6f95543b4
bpo-39576: Prevent memory error for overly optimistic precisions (GH-18581) (#18585)
(cherry picked from commit 90930e6545)

Authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-21 02:15:41 +01:00
Miss Islington (bot) 736e0eaf5b
Valgrind no longer supports --db-attach=yes. (GH-18568) (#18578)
(cherry picked from commit c0cb8beb38)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:54:37 +01:00
Miss Islington (bot) a3c2c5f15b
Use the new recommended number of repetitions in the refleak tests. (GH-18569) (#18575)
(cherry picked from commit 1246d89203)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:37:23 +01:00
Miss Islington (bot) 25749101ad
Update runall.bat to the latest Windows build system. (GH-18571) (#18572)
(cherry picked from commit 9b833e00e4)

Co-authored-by: Stefan Krah <skrah@bytereef.org>

Co-authored-by: Stefan Krah <skrah@bytereef.org>
2020-02-20 19:30:00 +01:00
Miss Islington (bot) 97d2a98324
closes bpo-39510: Fix use-after-free in BufferedReader.readinto() (GH-18295)
When called on a closed object, readinto() segfaults on account
of a write to a freed buffer:

    ==220553== Process terminating with default action of signal 11 (SIGSEGV): dumping core
    ==220553==  Access not within mapped region at address 0x2A
    ==220553==    at 0x48408A0: memmove (vg_replace_strmem.c:1272)
    ==220553==    by 0x58DB0C: _buffered_readinto_generic (bufferedio.c:972)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto_impl (bufferedio.c:1053)
    ==220553==    by 0x58DCBA: _io__Buffered_readinto (bufferedio.c.h:253)

Reproducer:

    reader = open ("/dev/zero", "rb")
    _void  = reader.read (42)
    reader.close ()
    reader.readinto (bytearray (42)) GH-GH-GH- BANG!

The problem exists since 2012 when commit dc469454ec added code
to free the read buffer on close().

Signed-off-by: Philipp Gesang <philipp.gesang@intra2net.com>
(cherry picked from commit cb1c0746f2)

Co-authored-by: Philipp Gesang <phg@phi-gamma.net>
2020-02-04 13:43:07 -08:00
Miss Islington (bot) 958064f8d2
bpo-39421: Fix posible crash in heapq with custom comparison operators (GH-18118)
* bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators

* fixup! fixup! bpo-39421: Fix posible crash in heapq with custom comparison operators
(cherry picked from commit 79f89e6e5a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2020-01-23 06:25:31 -08:00
Vinay Sajip 9dbf5d3bc2
[3.7] bpo-16575: Disabled checks for union types being passed by value. (GH-17960) (GH-17970)
Although the underlying libffi issue remains open, adding these
checks have caused problems in third-party projects which are in
widespread use. See the issue for examples.

The corresponding tests have also been skipped.
(cherry picked from commit c12440c371)
2020-01-12 20:55:54 +00:00
Inada Naoki 26892c7d5f Add PYTHONUTF8 to commandline usage. (GH-17587) (GH-17599)
Co-Authored-By: Victor Stinner <vstinner@python.org>
(cherry picked from commit 95826c773a)
2019-12-14 11:53:43 +01:00
Miss Islington (bot) a197f8aa74
[3.7] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17500)
test_openssl_version now accepts version 3.0.0.

getpeercert() no longer returns IPv6 addresses with a trailing new line.

Signed-off-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820
(cherry picked from commit 2b7de6696b)


Co-authored-by: Christian Heimes <christian@python.org>


https://bugs.python.org/issue38820



Automerge-Triggered-By: @tiran
2019-12-07 09:20:43 -08:00
Andrew Svetlov 8ce85a31e6
[3.7] Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python version (GH-17484) (GH-17494)
(cherry picked from commit 969ae7aca8)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-12-07 13:46:18 +02:00
Miss Islington (bot) 5044c889df
bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467)
Use the "volatile" keyword to prevent tail call optimization
on any compiler, rather than relying on compiler specific pragma.
(cherry picked from commit 8b787964e0)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-12-04 12:29:22 -08:00
Miss Islington (bot) bff5255664
bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338)
Increment properly Py_True/Py_False reference counter for
_testcapi.WITH_PYMALLOC variable.
(cherry picked from commit 84c36c152a)

Co-authored-by: Victor Stinner <vstinner@python.org>
2019-11-22 04:56:59 -08:00
Miss Islington (bot) 91c15a542c [3.7] bpo-16576: Add checks for bitfields passed by value to functions. (GH-17097) (GH-17224)
(cherry picked from commit 106271568c)
2019-11-21 21:47:22 +00:00
Miss Islington (bot) 1d7245c3e0
bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)
(cherry picked from commit d51a363a43)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-20 02:26:54 -08:00
Miss Islington (bot) 5bd2af9c79
bpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)
(cherry picked from commit ac2235432c)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-19 15:30:02 -08:00
Miss Islington (bot) 9e4d031210
bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)
https://bugs.python.org/issue38823
(cherry picked from commit 289cf0fbf7)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-18 07:09:43 -08:00
Miss Islington (bot) 8a334af133
bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)
https://bugs.python.org/issue38823
(cherry picked from commit 143a97f641)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-16 16:14:45 -08:00
Miss Islington (bot) 825e91be04
bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)
https://bugs.python.org/issue38823
(cherry picked from commit c3f6bdc332)

Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
2019-11-16 14:45:24 -08:00
Miss Islington (bot) 87b4d3994e
bpo-38785: Prevent asyncio from crashing (GH-17144)
if parent `__init__` is not called from a constructor of object derived from `asyncio.Future`

https://bugs.python.org/issue38785
(cherry picked from commit dad6be5ffe)

Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
2019-11-13 13:54:50 -08:00
Benjamin Peterson b8b3e4377e
[3.7] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode files. (GH-17137)
This change, which follows the behavior of C stdio's fdopen and Python 2's file object, allows pipes to be opened in append mode..
(cherry picked from commit 74fa9f723f)
2019-11-12 15:34:43 -08:00
Ammar Askar 484edbf9bf bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)
The master and 3.8 versions of the previous change work as expected
because we perform the lookup for the `from_param` after the union
check. However, in 3.7, this lookup happens before the union
validation and so we must decrease the reference for `cnv` before
returning.
2019-11-06 15:40:06 +00:00
Vinay Sajip 0118d109d5
[3.7] bpo-16575: Add checks for unions passed by value to functions. (GH-16799) (GH-17017)
(cherry picked from commit 79d4ed102a)
2019-10-31 14:15:04 +00:00
Pablo Galindo a081e93150 [3.7] bpo-38379: don't claim objects are collected when they aren't (GH-16658) (GH-16685)
* [bpo-38379](https://bugs.python.org/issue38379):  when a finalizer resurrects an object,
nothing is actually collected in this run of gc.
Change the stats to relect that truth..
(cherry picked from commit ecbf35f933)

Co-authored-by: Tim Peters <tim.peters@gmail.com>





https://bugs.python.org/issue38379



Automerge-Triggered-By: @pablogsal
2019-10-09 14:42:54 -07:00
Vinay Sajip 129c2b3d44
bpo-38368: Added fix for ctypes crash when handling arrays in structs/unions. (GH-16589) (GH-16672)
(cherry picked from commit e8bedbddad)
2019-10-09 06:48:48 +01:00
Miss Islington (bot) 6c3fbbc177
bpo-13153: Use OS native encoding for converting between Python and Tcl. (GH-16545)
On Windows use UTF-16 (or UTF-32 for 32-bit Tcl_UniChar) with the
"surrogatepass" error handler for converting to/from Tcl Unicode objects.

On Linux use UTF-8 with the "surrogateescape" error handler for converting
to/from Tcl String objects.

Converting strings from Tcl to Python and back now never fails
(except MemoryError).
(cherry picked from commit 06cb94bc84)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-10-04 03:28:53 -07:00
Benjamin Peterson 8e4622ea89
[3.7] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16407)
Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes..
(cherry picked from commit 52b9408038)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-09-25 21:54:59 -07:00