summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-38368: Added fix for ctypes crash when handling arrays in ↵Vinay Sajip2019-10-142-25/+179
| | | | | structs/unions. (GH-16589) (GH-16672) (cherry picked from commit e8bedbddadaa86be6bd86dc32dbdbd53933a4988)
* [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>
* bpo-32627: Fix compile error when conflicting `_uuid` headers included ↵Miss Islington (bot)2019-06-241-3/+6
| | | | | | | (GH-11751) (cherry picked from commit 6ffd9b05dfade9e3a101fe039157856eb855f82e) Co-authored-by: ziheng <zihenglv@gmail.com>
* Fix name of '\0'. (GH-14222)Miss Islington (bot)2019-06-191-1/+1
| | | | | | '\0' is the NUL byte not NULL. (cherry picked from commit 7821b4c6d29933511d50bb42255e39790c6abf00) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-36779: time.tzname returns empty string on Windows if default cod… ↵Miss Islington (bot)2019-06-131-0/+14
| | | | | | | | | | | | | | | | | (GH-13073) Calling setlocale(LC_CTYPE, "") on a system where GetACP() returns CP_UTF8 results in empty strings in _tzname[]. This causes time.tzname to be an empty string. I have reported the bug to the UCRT team and will follow up, but it will take some time get a fix into production. In the meantime one possible workaround is to temporarily change the locale by calling setlocale(LC_CTYPE, "C") before calling _tzset and restore the current locale after if the GetACP() == CP_UTF8 or CP_UTF7 @zooba https://bugs.python.org/issue36779 (cherry picked from commit b4c7defe58695a6670a8fdeaef67a638bbb47e42) Co-authored-by: Paul Monson <paulmon@users.noreply.github.com>
* bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)Miss Islington (bot)2019-06-131-15/+17
| | | | | (cherry picked from commit 8725c83ed5ca8959195ad8326db99d564a921749) Co-authored-by: Jeffrey Kintscher <49998481+websurfer5@users.noreply.github.com>
* bpo-31829: Make protocol 0 pickles be loadable in text mode in Python 2. ↵Miss Islington (bot)2019-06-121-1/+4
| | | | | | | | (GH-11859) Escape ``\r``, ``\0`` and ``\x1a`` (end-of-file on Windows) in Unicode strings. (cherry picked from commit 38ab7d4721b422547f7b46b9d68968863fa70573) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-29505: Fuzz json module, enforce size limit on int(x) fuzz (GH-13991)Miss Islington (bot)2019-06-1210-1/+171
| | | | | | | | * bpo-29505: Enable fuzz testing of the json module, enforce size limit on int(x) fuzz and json input size to avoid timeouts. Contributed by by Ammar Askar for Google. (cherry picked from commit a6e190e94b47324f14e22a09200c68b722d55699) Co-authored-by: Ammar Askar <aaskar@google.com>
* closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup parsing ↵Miss Islington (bot)2019-06-111-1/+1
| | | | | | | | | | | of pyexpat line in Setup. (GH-13064) When the line is uncommented, the equals character causes it to be incorrectly interpreted as a macro definition by makesetup. This results in invalid Makefile output. The expat code only requires XML_POOR_ENTROPY to be defined; the value is unnecessary. (cherry picked from commit 408a2ef1aceff1f4270c44552fa39ef93d9283e3) Co-authored-by: aaronpaulhurst <aaronpaulhurst@gmail.com>
* bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)Miss Islington (bot)2019-06-081-0/+8
| | | | | (cherry picked from commit a15a7bcaea54e1845ab2abe27e6f583294cd715b) Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
* [3.7] bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() ↵Zackery Spytz2019-06-071-0/+22
| | | | | | | (GH-13860) (GH-13896) (cherry picked from commit dc2476500d91082f0c907772c83a044bf49af279) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (GH-13881) (#13882)Miss Islington (bot)2019-06-071-1/+1
|
* Fix the error handling in bytesio_sizeof(). (GH-10459)Miss Islington (bot)2019-06-011-2/+7
| | | | | | bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf(). (cherry picked from commit 36dcaab7fde5d2e54cdeff5b705b5adcb27726dd) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-36856: Handle possible overflow in faulthandler_stack_overflow (GH-13205)Miss Islington (bot)2019-05-281-4/+17
| | | | | (cherry picked from commit 6236c9823ef3e8e2229b0598d3d8189adf5e00f2) Co-authored-by: Xi Ruoyao <xry111@mengyan1223.wang>
* bpo-23395: Fix PyErr_SetInterrupt if the SIGINT signal is ignored or not ↵Miss Islington (bot)2019-05-241-4/+9
| | | | | | | | handled (GH-7778) ``_thread.interrupt_main()`` now avoids setting the Python error status if the ``SIGINT`` signal is ignored or not handled by Python. (cherry picked from commit 608876b6b1eb59538e6c29671a733033fb8b5be7) Co-authored-by: Matěj Cepl <mcepl@cepl.eu>
* bpo-36965: Fix includes in main.c on Windows with non-MSC compilers ↵Erik Janssens2019-05-221-2/+2
| | | | | | | | (GH-13421) (GH-13471) Include windows.h rather than crtdbg.h to get STATUS_CONTROL_C_EXIT constant. Moreover, include windows.h on Windows, not only when MSC is used. (cherry picked from commit 925af1d99b69bf3e229411022ad840c5a0cfdcf8)
* bpo-36908: 'This module is always available' isn't helpful. (GH-13297)Miss Islington (bot)2019-05-172-4/+4
| | | | | | | Makes the documentation of math and cmath module more helpful for the beginners. (cherry picked from commit 6faad355db6c2bd4a0ade7868f245b42c04f5337) Co-authored-by: Ned Batchelder <ned@nedbatchelder.com>
* bpo-36946: Fix possible signed integer overflow when handling slices. (GH-13375)Miss Islington (bot)2019-05-174-8/+16
| | | | | | | | | | The final addition (cur += step) may overflow, so use size_t for "cur". "cur" is always positive (even for negative steps), so it is safe to use size_t here. Co-Authored-By: Martin Panter <vadmium+py@gmail.com> (cherry picked from commit 14514d9084a40f599c57da853a305aa264562a43) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35926: Add support for OpenSSL 1.1.1b on Windows (GH-11779)Steve Dower2019-05-161-1/+1
|