Commit Graph

10814 Commits

Author SHA1 Message Date
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
Vinay Sajip d015714f89
[3.7] bpo-22273: Changed conditions for ctypes array-in-struct handling. (GH-16381) (GH-16400)
(cherry picked from commit c64af8fad3)
2019-09-25 21:37:24 +01:00
Miss Islington (bot) 16c0f6df62 bpo-22273: Update ctypes to correctly handle arrays in small structur… (GH-15839) (GH-16369)
(cherry picked from commit 12f209eccb)
2019-09-25 05:10:43 +01:00
Miss Islington (bot) 80cb055aa4
bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190)
(cherry picked from commit f669581a95)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-16 23:39:49 -07:00
Miss Islington (bot) 4ac1be2828
bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)
(cherry picked from commit 8debfa5040)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-16 23:14:30 -07:00
Miss Islington (bot) c55f69552c
[3.7] bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140) (GH-16200)
``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. 


https://bugs.python.org/issue33936
(cherry picked from commit 724f1a5723)


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


https://bugs.python.org/issue33936



Automerge-Triggered-By: @tiran
2019-09-16 12:49:07 -07:00
Miss Islington (bot) e857fe624d
[3.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c (GH-16136) (GH-16175)
(cherry picked from commit 56a45142e7)


Co-authored-by: Hai Shi <shihai1992@gmail.com>

Automerge-Triggered-By: @zhangyangyu
2019-09-15 23:27:38 -07:00
Miss Islington (bot) a3c53a1b45
bpo-21872: fix lzma library decompresses data incompletely (GH-14048)
* 1. add test case with wrong behavior
* 2. fix bug when max_length == -1
* 3. allow b"" as valid input data for decompress_buf()
* 4. when max_length >= 0, let needs_input mechanism works
* add more asserts to test case
(cherry picked from commit 4ffd05d7ec)

Co-authored-by: animalize <animalize@users.noreply.github.com>
2019-09-12 07:41:30 -07:00
Miss Islington (bot) 197ac1ad1c
closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for failure. (GH-16011)
An exception may occur during a PyObject_IsSubclass() call.
(cherry picked from commit ea683deccc)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-12 03:30:55 -07:00
Miss Islington (bot) 4fbe0ee548 Fix calling order of PyEval_InitThreads. (GH-5833)
As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called
before Py_Initialize() function.
(cherry picked from commit 9e61066355)

Co-authored-by: Kenta Murata <mrkn@users.noreply.github.com>
2019-09-10 15:37:34 +01:00
Michael Felt 61f34f9f63 bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-14238) 2019-09-10 14:30:18 +01:00
Steve Dower b4fb2c29f3
bpo-35941: Fix performance regression in SSL certificate code (GH-12610)
Accumulate certificates in a set instead of doing a costly list contain
operation. A Windows cert store can easily contain over hundred
certificates. The old code would result in way over 5,000 comparison
operations

Signed-off-by: Christian Heimes <christian@python.org>
2019-09-10 01:46:40 -07:00
Miss Islington (bot) 328cfde754
bpo-37649: Fix exec_prefix check (GH-14897)
(cherry picked from commit 09090d04ef)

Co-authored-by: Orivej Desh <orivej@gmx.fr>
2019-09-09 11:12:00 -07:00
Miss Islington (bot) 472f37ab9a
bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)
ssl_collect_certificates function in _ssl.c has a memory leak.
Calling CertOpenStore() and CertAddStoreToCollection(), a store's refcnt gets incremented by 2.
But CertCloseStore() is called only once and the refcnt leaves 1.
(cherry picked from commit ed70129e15)

Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
2019-09-09 06:40:42 -07:00
Miss Islington (bot) 1af2c0ec2f
bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls (GH-14462)
If FormatMessageW() is passed the FORMAT_MESSAGE_FROM_SYSTEM flag without FORMAT_MESSAGE_IGNORE_INSERTS, it will fail if there are insert sequences in the message definition.
(cherry picked from commit a6563650c8)

Co-authored-by: Zackery Spytz <zspytz@gmail.com>
2019-09-09 02:56:03 -07:00
Miss Islington (bot) 5190b7193c
bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)
RuntimeError is now raised in this case.
(cherry picked from commit 526a01467b)

Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
2019-09-09 02:11:22 -07:00
Miss Islington (bot) 021e5db20b
bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)
This is a complement to PR 13375.
(cherry picked from commit 3c87a667bb)

Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
2019-09-08 03:36:38 -07:00
Miss Islington (bot) 6b50c10f67
bpo-37372: Fix error unpickling datetime.time objects from Python 2 with seconds>=24. (GH-14307)
(cherry picked from commit 122376df55)

Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
2019-08-29 00:57:41 -07:00
Miss Islington (bot) 1bf672f53a
bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)
(cherry picked from commit 8bf5fef873)

Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
2019-08-26 21:31:27 -07:00
Pablo Galindo 1b1796df3a
[3.7] bpo-37915: Fix comparison between tzinfo objects and timezone objects (GH-15390) (GH-15417)
https://bugs.python.org/issue37915

Automerge-Triggered-By: @pablogsal.
(cherry picked from commit 4be11c009a)

Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2019-08-23 11:12:31 +01:00
Paul Ganssle ed44b84961
bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15226)
This fixes an inconsistency between the Python and C implementations of
the datetime module. The pure python version of the code was not
accepting offsets greater than 23:59 but less than 24:00. This is an
accidental legacy of the original implementation, which was put in place
before tzinfo allowed sub-minute time zone offsets.

GH-14878

(cherry picked from commit 92c7e30adf)
2019-08-15 15:09:37 -04:00
Miss Islington (bot) 2b9b70765c
Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard PEM_read_bio_X509 (GH-15303)
X509_AUX is an odd, note widely used, OpenSSL extension to the X509 file format. This function doesn't actually use any of the extra metadata that it parses, so just use the standard API.

Automerge-Triggered-By: @tiran
(cherry picked from commit 40dad9545a)

Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
2019-08-15 05:55:59 -07:00
Miss Islington (bot) 1581d9c405
bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)
faulthandler now allocates a dedicated stack of SIGSTKSZ*2 bytes,
instead of just SIGSTKSZ bytes. Calling the previous signal handler
in faulthandler signal handler uses more than SIGSTKSZ bytes of stack
memory on some platforms.
(cherry picked from commit ac827edc49)

Co-authored-by: Victor Stinner <vstinner@redhat.com>
2019-08-14 15:09:39 -07:00
Miss Islington (bot) b0b178a2b8
bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)
FreeBSD implementation of poll(2) restricts the timeout argument to be
either zero, or positive, or equal to INFTIM (-1).

Unless otherwise overridden, socket timeout defaults to -1. This value
is then converted to milliseconds (-1000) and used as argument to the
poll syscall. poll returns EINVAL (22), and the connection fails.

This bug was discovered during the EINTR handling testing, and the
reproduction code can be found in
https://bugs.python.org/issue23618 (see connect_eintr.py,
attached). On GNU/Linux, the example runs as expected.

This change is trivial:
If the supplied timeout value is negative, truncate it to -1.
(cherry picked from commit 2814620657)

Co-authored-by: Artem Khramov <akhramov@pm.me>
2019-08-14 14:48:03 -07:00
Victor Stinner 7eef81ee76
bpo-37738: Fix curses addch(str, color_pair) (GH-15071) (GH-15273)
Fix the implementation of curses addch(str, color_pair): pass the
color pair to setcchar(), instead of always passing 0 as the color
pair.

(cherry picked from commit 077af8c2c9)
2019-08-14 13:00:27 +02:00
Serhiy Storchaka 6ed20e54e4
[3.7] bpo-37685: Fixed comparisons of datetime.timedelta and datetime.timezone. (GH-14996) (GH-15104)
There was a discrepancy between the Python and C implementations.

Add singletons ALWAYS_EQ, LARGEST and SMALLEST in test.support
to test mixed type comparison.
(cherry picked from commit 17e52649c0)
2019-08-04 15:28:21 +03:00
Miss Islington (bot) 35d9c37e27
bpo-37695: Correct unget_wch error message. (GH-14986)
(cherry picked from commit c9345e382c)

Co-authored-by: Anthony Sottile <asottile@umich.edu>
2019-07-31 13:25:45 -07:00
Kyle Stanley 83cec020ba [3.7] Fix typos in docs, comments and test assert messages (GH-14872). (#14901)
(cherry picked from commit 96e12d5f4f)

Co-authored-by: Min ho Kim <minho42@gmail.com>
2019-07-22 14:14:07 -04:00
Miss Islington (bot) f3130fab9c
Put pyexpatns.h include back. bpo-37437 (GH-14539)
(cherry picked from commit 2cd07920bb)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-07-01 22:29:05 -07:00
Miss Islington (bot) cf7617460a
[3.7] bpo-37428: Don't set PHA verify flag on client side (GH-14421) (GH-14493)
SSLContext.post_handshake_auth = True no longer sets
SSL_VERIFY_POST_HANDSHAKE verify flag for client connections. Although the
option is documented as ignored for clients, OpenSSL implicitly enables cert
chain validation when the flag is set.

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



https://bugs.python.org/issue37428
(cherry picked from commit f0f5930ac8)


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


https://bugs.python.org/issue37428
2019-06-30 23:51:40 -07:00
Miss Islington (bot) 87cc66877c
closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)
(cherry picked from commit 3b03b09fc9)

Co-authored-by: Benjamin Peterson <benjamin@python.org>
2019-06-27 21:15:09 -07:00