summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Add PYTHONUTF8 to commandline usage. (GH-17587) (GH-17599)Inada Naoki2019-12-181-0/+1
| | | | Co-Authored-By: Victor Stinner <vstinner@python.org> (cherry picked from commit 95826c773a9004fc5b3c89de55f800504685ab21)
* [3.7] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17500)Miss Islington (bot)2019-12-071-1/+48
| | | | | | | | | | | | | | | | | | | | | 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 2b7de6696bf2f924cd2cd9ff0a539c8aa37c6244) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38820 Automerge-Triggered-By: @tiran
* [3.7] Make repr of C accelerated TaskWakeupMethWrapper the same as of pure ↵Andrew Svetlov2019-12-071-0/+16
| | | | | | | Python version (GH-17484) (GH-17494) (cherry picked from commit 969ae7aca809a8dacafee04c261110eea0ac1945) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-38965: Fix faulthandler._stack_overflow() on GCC 10 (GH-17467)Miss Islington (bot)2019-12-041-10/+6
| | | | | | | Use the "volatile" keyword to prevent tail call optimization on any compiler, rather than relying on compiler specific pragma. (cherry picked from commit 8b787964e0a647caa0558b7c29ae501470d727d9) Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338)Miss Islington (bot)2019-11-221-2/+5
| | | | | | | Increment properly Py_True/Py_False reference counter for _testcapi.WITH_PYMALLOC variable. (cherry picked from commit 84c36c152a2bdf98f9cc7ce0e1db98e1f442a05e) Co-authored-by: Victor Stinner <vstinner@python.org>
* [3.7] bpo-16576: Add checks for bitfields passed by value to functions. ↵Miss Islington (bot)2019-11-212-7/+64
| | | | | (GH-17097) (GH-17224) (cherry picked from commit 106271568c58cfebae58f0c52b640dbe716ba2ce)
* bpo-38823: Fix refleak in _tracemalloc init error handling (GH-17235)Miss Islington (bot)2019-11-201-1/+3
| | | | | (cherry picked from commit d51a363a4379385fdfe9c09a56324631465ede29) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-38823: Fix refleaks in faulthandler init error path on Windows (GH-17250)Miss Islington (bot)2019-11-191-10/+21
| | | | | (cherry picked from commit ac2235432c607ce2c0faf6dff5d9b2534d2f6652) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-38823: Clean up refleaks in _tkinter initialization. (GH-17206)Miss Islington (bot)2019-11-181-0/+2
| | | | | | https://bugs.python.org/issue38823 (cherry picked from commit 289cf0fbf78c4f38c38ac71ac8b772be7ec2672f) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-38823: Clean up refleaks in _contextvars initialization. (GH-17198)Miss Islington (bot)2019-11-171-0/+3
| | | | | | https://bugs.python.org/issue38823 (cherry picked from commit 143a97f64128070386b12a0ee589bdaad5e51f40) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-38823: Clean up refleaks in _asyncio initialization. (GH-17195)Miss Islington (bot)2019-11-161-0/+4
| | | | | | https://bugs.python.org/issue38823 (cherry picked from commit c3f6bdc332d23588102eba749a5929dd5bb67c9d) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>
* bpo-38785: Prevent asyncio from crashing (GH-17144)Miss Islington (bot)2019-11-131-0/+1
| | | | | | | | if parent `__init__` is not called from a constructor of object derived from `asyncio.Future` https://bugs.python.org/issue38785 (cherry picked from commit dad6be5ffe48beb74fad78cf758b886afddc7aed) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* [3.7] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode ↵Benjamin Peterson2019-11-121-9/+15
| | | | | | 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 74fa9f723f700a342e582b5ad4b51a2c4801cd1c)
* bpo-16575: Fix refleak on passing unions in ctypes (GH-17064)Ammar Askar2019-11-061-0/+1
| | | | | | | 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.
* [3.7] bpo-16575: Add checks for unions passed by value to functions. ↵Vinay Sajip2019-10-314-0/+97
| | | | | (GH-16799) (GH-17017) (cherry picked from commit 79d4ed102a5069c6cebaed2627cb1645637f0429)
* [3.7] bpo-38379: don't claim objects are collected when they aren't ↵Pablo Galindo2019-10-091-7/+4
| | | | | | | | | | | | | | | | | | | | (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 ecbf35f9335b0420cb8adfda6f299d6747a16515) Co-authored-by: Tim Peters <tim.peters@gmail.com> https://bugs.python.org/issue38379 Automerge-Triggered-By: @pablogsal
* bpo-38368: Added fix for ctypes crash when handling arrays in ↵Vinay Sajip2019-10-092-25/+179
| | | | | structs/unions. (GH-16589) (GH-16672) (cherry picked from commit e8bedbddadaa86be6bd86dc32dbdbd53933a4988)
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Miss Islington (bot)2019-10-041-173/+202
| | | | | | | | | | | | | | | (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 06cb94bc8419b9a24df6b0d724fcd8e40c6971d6) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.7] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16407)Benjamin Peterson2019-09-2619-4834/+3971
| | | | | | Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes.. (cherry picked from commit 52b940803860e37bcc3f6096b2d24e7c20a0e807) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.7] bpo-22273: Changed conditions for ctypes array-in-struct handling. ↵Vinay Sajip2019-09-251-7/+4
| | | | | (GH-16381) (GH-16400) (cherry picked from commit c64af8fad3c4f5751af624647fbb0ce023f525dc)
* bpo-22273: Update ctypes to correctly handle arrays in small structur… ↵Miss Islington (bot)2019-09-252-0/+146
| | | | | (GH-15839) (GH-16369) (cherry picked from commit 12f209eccb1587e8c98057d9c5f865c21f4a16c1)
* bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. ↵Miss Islington (bot)2019-09-171-31/+31
| | | | | | | (GH-16190) (cherry picked from commit f669581a9527afb0d2325f9845a86715c0ba365d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155)Miss Islington (bot)2019-09-171-5/+7
| | | | | (cherry picked from commit 8debfa50407107ff2329d01081cdc12d359f1d12) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.7] bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ ↵Miss Islington (bot)2019-09-161-1/+1
| | | | | | | | | | | | | | | | | | | (GH-16140) (GH-16200) ``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. https://bugs.python.org/issue33936 (cherry picked from commit 724f1a57231f9287c37255adf0e4364d12cf693d) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue33936 Automerge-Triggered-By: @tiran
* [3.7] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c ↵Miss Islington (bot)2019-09-161-1/+2
| | | | | | | | | | (GH-16136) (GH-16175) (cherry picked from commit 56a45142e70a1ccf3233d43cb60c47255252e89a) Co-authored-by: Hai Shi <shihai1992@gmail.com> Automerge-Triggered-By: @zhangyangyu
* bpo-21872: fix lzma library decompresses data incompletely (GH-14048)Miss Islington (bot)2019-09-121-6/+22
| | | | | | | | | | * 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 4ffd05d7ec47cfd0d7fc95dce851633be9663255) Co-authored-by: animalize <animalize@users.noreply.github.com>
* closes bpo-38127: _ctypes: PyObject_IsSubclass() should be checked for ↵Miss Islington (bot)2019-09-121-1/+5
| | | | | | | | failure. (GH-16011) An exception may occur during a PyObject_IsSubclass() call. (cherry picked from commit ea683deccc505a78bbbb1eb8c6a88b0835ad5151) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* Fix calling order of PyEval_InitThreads. (GH-5833)Miss Islington (bot)2019-09-101-1/+1
| | | | | | | As described in Doc/c-api/init.rst, PyEval_InitThreads() cannot be called before Py_Initialize() function. (cherry picked from commit 9e61066355b4b55c873d56f5f106a22463b56862) Co-authored-by: Kenta Murata <mrkn@users.noreply.github.com>
* bpo-34720: Fix test_importlib.test_bad_traverse for AIX (GH-14238)Michael Felt2019-09-101-0/+8
|
* bpo-35941: Fix performance regression in SSL certificate code (GH-12610)Steve Dower2019-09-101-29/+27
| | | | | | | | 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>
* bpo-37649: Fix exec_prefix check (GH-14897)Miss Islington (bot)2019-09-091-1/+1
| | | | | (cherry picked from commit 09090d04ef8d2f4c94157b852d3d530a51e13d22) Co-authored-by: Orivej Desh <orivej@gmx.fr>
* bpo-37702: Fix SSL's certificate-store leak on Windows (GH-15632)Miss Islington (bot)2019-09-091-0/+1
| | | | | | | | 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 ed70129e15ea028469145111044a4349960a4e6f) Co-authored-by: neonene <53406459+neonene@users.noreply.github.com>
* bpo-37445: Include FORMAT_MESSAGE_IGNORE_INSERTS in FormatMessageW() calls ↵Miss Islington (bot)2019-09-092-2/+5
| | | | | | | | (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 a6563650c835d50f7302971a5b145e94f9d0dc68) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-34410: Fix a crash in the tee iterator when re-enter it. (GH-15625)Miss Islington (bot)2019-09-091-0/+9
| | | | | | RuntimeError is now raised in this case. (cherry picked from commit 526a01467b3277f9fcf7f91e66c23321caa1245d) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-36946:Fix possible signed integer overflow when handling slices. (GH-15639)Miss Islington (bot)2019-09-081-1/+2
| | | | | | This is a complement to PR 13375. (cherry picked from commit 3c87a667bb367ace1de6bd1577fdb4f66947da52) Co-authored-by: HongWeipeng <hongweichen8888@sina.com>
* bpo-37372: Fix error unpickling datetime.time objects from Python 2 with ↵Miss Islington (bot)2019-08-291-1/+1
| | | | | | | seconds>=24. (GH-14307) (cherry picked from commit 122376df550b71dd3bec0513c7483cc1714212fa) Co-authored-by: Justin Blanchard <UncombedCoconut@gmail.com>
* bpo-36205: Fix the rusage implementation of time.process_time() (GH-15538)Miss Islington (bot)2019-08-271-1/+1
| | | | | (cherry picked from commit 8bf5fef8737fdd12724b9340d76a4ed391c4ad8a) Co-authored-by: vrajivk <3413293+vrajivk@users.noreply.github.com>
* [3.7] bpo-37915: Fix comparison between tzinfo objects and timezone objects ↵Pablo Galindo2019-08-231-1/+3
| | | | | | | | | | (GH-15390) (GH-15417) https://bugs.python.org/issue37915 Automerge-Triggered-By: @pablogsal. (cherry picked from commit 4be11c009abe88175fa164b45e4838e7267dfa97) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-37642: Update acceptable offsets in timezone (GH-14878) (#15226)Paul Ganssle2019-08-151-2/+9
| | | | | | | | | | | 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 92c7e30adf5c81a54d6e5e555a6bdfaa60157a0d)
* Replace usage of the obscure PEM_read_bio_X509_AUX with the more standard ↵Miss Islington (bot)2019-08-151-1/+1
| | | | | | | | | | 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 40dad9545aad4ede89abbab1c1beef5303d9573e) Co-authored-by: Alex Gaynor <alex.gaynor@gmail.com>
* bpo-21131: Fix faulthandler.register(chain=True) stack (GH-15276)Miss Islington (bot)2019-08-141-1/+5
| | | | | | | | | 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 ac827edc493d3ac3f5b9b0cc353df1d4b418a9aa) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-37811: FreeBSD, OSX: fix poll(2) usage in sockets module (GH-15202)Miss Islington (bot)2019-08-141-0/+11
| | | | | | | | | | | | | | | | | | | 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 28146206578ebe1b84b48e6f255738a227058c04) Co-authored-by: Artem Khramov <akhramov@pm.me>
* bpo-37738: Fix curses addch(str, color_pair) (GH-15071) (GH-15273)Victor Stinner2019-08-141-3/+15
| | | | | | | 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 077af8c2c93dd71086e2c5e5ff1e634b6da8f214)
* [3.7] bpo-37685: Fixed comparisons of datetime.timedelta and ↵Serhiy Storchaka2019-08-041-5/+2
| | | | | | | | | | 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 17e52649c0e7e9389f1cc2444a53f059e24e6bca)
* bpo-37695: Correct unget_wch error message. (GH-14986)Miss Islington (bot)2019-07-311-2/+2
| | | | | (cherry picked from commit c9345e382c630ddcc2b148b30954640e0e435c8a) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* [3.7] Fix typos in docs, comments and test assert messages (GH-14872). (#14901)Kyle Stanley2019-07-221-1/+1
| | | | | (cherry picked from commit 96e12d5f4f3c5a20986566038ee763dff3c228a1) Co-authored-by: Min ho Kim <minho42@gmail.com>
* Put pyexpatns.h include back. bpo-37437 (GH-14539)Miss Islington (bot)2019-07-021-0/+4
| | | | | (cherry picked from commit 2cd07920bb7d2d319999394092190f37935dc421) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.7] bpo-37428: Don't set PHA verify flag on client side (GH-14421) (GH-14493)Miss Islington (bot)2019-07-011-17/+26
| | | | | | | | | | | | | | | | | | | 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 f0f5930ac88482ef896283db5be9b8d508d077db) Co-authored-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue37428
* closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)Miss Islington (bot)2019-06-286-32/+21
| | | | | (cherry picked from commit 3b03b09fc94425915c5b1225e9200a3a95bc827b) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. ↵Miss Islington (bot)2019-06-271-0/+3
| | | | | | | (GH-14414) (cherry picked from commit 45a30af109f69a81576b87ea775863ba12d55316) Co-authored-by: Brandt Bucher <brandtbucher@gmail.com>