summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* [3.8] bpo-38820: OpenSSL 3.0.0 compatibility. (GH-17190) (GH-17499)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
* Make repr of C accelerated TaskWakeupMethWrapper the same as of pure Python ↵Miss Islington (bot)2019-12-071-1/+17
| | | | | | | version (GH-17484) (cherry picked from commit 969ae7aca809a8dacafee04c261110eea0ac1945) Co-authored-by: Andrew Svetlov <andrew.svetlov@gmail.com>
* bpo-37931: Fix crash on OSX re-initializing os.environ (GH-15428)Miss Islington (bot)2019-12-061-5/+5
| | | | | | | | | | | | | On most platforms, the `environ` symbol is accessible everywhere. In a dylib on OSX, it's not easily accessible, you need to find it with _NSGetEnviron. The code was caching the *value* of environ. But a setenv() can change the value, leaving garbage at the old value. Fix: don't cache the value of environ, just read it every time. (cherry picked from commit 723f71abf7ab0a7be394f9f7b2daa9ecdf6fb1eb) Co-authored-by: Benoit Hudson <benoit@imgspc.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-38634: Allow non-apple build to cope with libedit (GH-16986)Miss Islington (bot)2019-12-041-19/+4
| | | | | | | | | | | | | | The readline module now detects if Python is linked to libedit at runtime on all platforms. Previously, the check was only done on macOS. If Python is used as a library by a binary linking to libedit, the linker resolves the rl_initialize symbol required by the readline module against libedit instead of libreadline, which leads to a segfault. Take advantage of the existing supporting code to have readline module being compatible with both situations. (cherry picked from commit 7105319ada2e663659020cbe9fdf7ff38f421ab2) Co-authored-by: serge-sans-paille <serge.guelton@telecom-bretagne.eu>
* bpo-36854: Fix reference counter in PyInit__testcapi() (GH-17338)Victor Stinner2019-11-221-2/+5
| | | | Increment properly Py_True/Py_False reference counter for _testcapi.WITH_PYMALLOC variable.
* 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-38622: Ensure ctypes.PyObj_FromPtr audit event passes tuples as a single ↵Miss Islington (bot)2019-11-181-2/+2
| | | | | | | argument (GH-17243) (cherry picked from commit dcf1f83de8678b09df5bd7d04ca5f4ef1cd02aca) Co-authored-by: Steve Dower <steve.dower@python.org>
* bpo-38622: Add missing audit events for ctypes module (GH-17158)Miss Islington (bot)2019-11-182-7/+65
| | | | | (cherry picked from commit 00923c63995e34cdc25d699478f113de99a69df9) Co-authored-by: Steve Dower <steve.dower@python.org>
* 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-16576: Add checks for bitfields passed by value to functions. (GH-17097) ↵Miss Islington (bot)2019-11-182-3/+60
| | | | | (GH-17223) (cherry picked from commit 106271568c58cfebae58f0c52b640dbe716ba2ce)
* 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-38677: Fix arraymodule error handling in module initialization. (GH-17039)Miss Islington (bot)2019-11-151-8/+12
| | | | | (cherry picked from commit b44ffc8b409fd539c5fb2b79385498e9fe168880) Co-authored-by: Marco Paolini <mpaolini@users.noreply.github.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.8] closes bpo-27805: Ignore ESPIPE in initializing seek of append-mode ↵Benjamin Peterson2019-11-121-9/+15
| | | | | | files. (GH-17136) 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-38684: haslib: fix build when Blake2 not enabled in OpenSSL (GH-17043)Miss Islington (bot)2019-11-061-1/+1
| | | | | (cherry picked from commit 6552563b3d5061816720a5a6c7d4ffd6ba35b98b) Co-authored-by: Alexandru Ardelean <ardeleanalex@gmail.com>
* [3.8] bpo-16575: Add checks for unions passed by value to functions. ↵Vinay Sajip2019-10-314-0/+98
| | | | | (GH-16799) (GH-17016) (cherry picked from commit 79d4ed102a5069c6cebaed2627cb1645637f0429)
* bpo-38418: Fixes audit event for os.system to be named 'os.system' (GH-16670)Miss Islington (bot)2019-10-181-2/+2
| | | | | | | | https://bugs.python.org/issue38418 Automerge-Triggered-By: @zooba (cherry picked from commit fbe3c76c7ce1eec887d332d801d3784212cc0f73) Co-authored-by: Steve Dower <steve.dower@python.org>
* [3.8] bpo-36389: Backport debug enhancements from master (GH-16796)Victor Stinner2019-10-152-5/+14
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612) bpo-36389, bpo-38376: The _PyObject_CheckConsistency() function is now also available in release mode. For example, it can be used to debug a crash in the visit_decref() function of the GC. Modify the following functions to also work in release mode: * _PyDict_CheckConsistency() * _PyObject_CheckConsistency() * _PyType_CheckConsistency() * _PyUnicode_CheckConsistency() Other changes: * _PyMem_IsPtrFreed(ptr) now also returns 1 if ptr is NULL (equals to 0). * _PyBytesWriter_CheckConsistency() now returns 1 and is only used with assert(). * Reorder _PyObject_Dump() to write safe fields first, and only attempt to render repr() at the end. (cherry picked from commit 6876257eaabdb30f27ebcbd7d2557278ce2e5705) * bpo-36389: Fix _PyBytesWriter in release mode (GH-16624) Fix _PyBytesWriter API when Python is built in release mode with assertions. (cherry picked from commit 60ec6efd96d95476fe5e38c491491add04f026e5) * bpo-38070: Enhance visit_decref() debug trace (GH-16631) subtract_refs() now pass the parent object to visit_decref() which pass it to _PyObject_ASSERT(). So if the "is freed" assertion fails, the parent is used in debug trace, rather than the freed object. The parent object is more likely to contain useful information. Freed objects cannot be inspected are are displayed as "<object at xxx is freed>" with no other detail. (cherry picked from commit 4d5f94b8cd20f804c7868c5395a15aa6032f874c) * Fix also a typo in PYMEM_DEADBYTE macro comment * bpo-36389: Add newline to _PyObject_AssertFailed() (GH-16629) Add a newline between the verbose object dump and the Py_FatalError() logs for readability. (cherry picked from commit 7775349895088a7ae68cecf0c74cf817f15e2c74)
* bpo-37731: Reorder includes in xmltok.c to avoid redefinition of ↵Miss Islington (bot)2019-10-121-8/+8
| | | | | | | _POSIX_C_SOURCE (GH-16733) (cherry picked from commit 8177404d520e81f16324a900f093adf3856d33f8) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* [3.8] bpo-38379: don't claim objects are collected when they aren't ↵Pablo Galindo2019-10-091-6/+4
| | | | | | | | | | | | | | | | | | | | (GH-16658) (GH-16683) * [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-16671) (cherry picked from commit e8bedbddadaa86be6bd86dc32dbdbd53933a4988)
* bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)Miss Islington (bot)2019-10-071-0/+7
| | | | | (cherry picked from commit 321def805abc5b7c92c7e90ca90cb2434fdab855) Co-authored-by: Ben Harper <btharper1221@gmail.com>
* 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.8] bpo-3832: Fix compiler warnings (GH-16518)Victor Stinner2019-10-012-2/+1
| | | | | | | | | | | | | | | | | | | | | | | * bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493) bpo-38248, bpo-38321: Fix warning: modules\_asynciomodule.c(2667): warning C4102: 'set_exception': unreferenced label The related goto has been removed by commit edad4d89e357c92f70c0324b937845d652b20afd. (cherry picked from commit efe74b6369a8d08f27c69703fcc1686966e51068) * bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492) bpo-22273, bpo-38321: Fix following warning: modules\_ctypes\stgdict.c(704): warning C4244: 'initializing': conversion from 'Py_ssize_t' to 'int', possible loss of data (cherry picked from commit c9a413ede47171a224c72dd34122005170caaad4)
* bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)Miss Islington (bot)2019-10-011-5/+1
| | | | | | | PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no longer return PyStatus: they cannot fail anymore. (cherry picked from commit 8462a4936b3a551dc546a6adea04a70b0a07ca67) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38304: Remove PyConfig.struct_size (GH-16500)Victor Stinner2019-09-301-7/+2
| | | | | For now, we'll rely on the fact that the config structures aren't covered by the stable ABI. We may revisit this in the future if we further explore the idea of offering a stable embedding API.
* Clear weakrefs in garbage found by the GC (GH-16495) (#16499)Miss Islington (bot)2019-09-301-0/+17
| | | | | | | | Fix a bug due to the interaction of weakrefs and the cyclic garbage collector. We must clear any weakrefs in garbage in order to prevent their callbacks from executing and causing a crash. (cherry picked from commit bcda460baf25062ab68622b3f043f52b9db4d21d) Co-authored-by: Neil Schemenauer <nas-github@arctrix.com>
* [3.8] bpo-38270: More fixes for strict crypto policy (GH-16418) (#16437)Christian Heimes2019-09-301-1/+1
| | | | | | | | | | | | | | | | test_hmac and test_hashlib test built-in hashing implementations and OpenSSL-based hashing implementations. Add more checks to skip OpenSSL implementations when a strict crypto policy is active. Use EVP_DigestInit_ex() instead of EVP_DigestInit() to initialize the EVP context. The EVP_DigestInit() function clears alls flags and breaks usedforsecurity flag again. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue38270. (cherry picked from commit 90558158093c0ad893102158fd3c2dd9f864e82e) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-38304: Add PyConfig.struct_size (GH-16451) (GH-16453)Victor Stinner2019-09-281-1/+8
| | | | | | | | | | | | | | | | | | | Add a new struct_size field to PyPreConfig and PyConfig structures to allow to modify these structures in the future without breaking the backward compatibility. * Replace private _config_version field with public struct_size field in PyPreConfig and PyConfig. * Public PyPreConfig_InitIsolatedConfig() and PyPreConfig_InitPythonConfig() return type becomes PyStatus, instead of void. * Internal _PyConfig_InitCompatConfig(), _PyPreConfig_InitCompatConfig(), _PyPreConfig_InitFromConfig(), _PyPreConfig_InitFromPreConfig() return type becomes PyStatus, instead of void. * Remove _Py_CONFIG_VERSION * Update the Initialization Configuration documentation. (cherry picked from commit 441b10cf2855955c86565f8d59e72c2efc0f0a57)
* [3.8] bpo-38234: Backport init path config changes from master (GH-16423)Victor Stinner2019-09-261-76/+119
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-38234: Py_SetPath() uses the program full path (GH-16357) Py_SetPath() now sets sys.executable to the program full path (Py_GetProgramFullPath()), rather than to the program name (Py_GetProgramName()). Fix also memory leaks in pathconfig_set_from_config(). (cherry picked from commit 1ce152a42eaa917d7763bce93f1e1ca72530d7ca) * bpo-38234: Add tests for Python init path config (GH-16358) (cherry picked from commit bb6bf7d342b4503a6227fd209fac934905b6a1aa) * bpo-38234: test_embed: test pyvenv.cfg and pybuilddir.txt (GH-16366) Add test_init_pybuilddir() and test_init_pyvenv_cfg() to test_embed to test pyvenv.cfg and pybuilddir.txt configuration files. Fix sysconfig._generate_posix_vars(): pybuilddir.txt uses UTF-8 encoding, not ASCII. (cherry picked from commit 52ad33abbfb6637d74932617c7013bae0ccf6e32) * bpo-38234: Cleanup getpath.c (GH-16367) * search_for_prefix() directly calls reduce() if found is greater than 0. * Add calculate_pybuilddir() subfunction. * search_for_prefix(): add path string buffer for readability. * Fix some error handling code paths: release resources on error. * calculate_read_pyenv(): rename tmpbuffer to filename. * test.pythoninfo now also logs windows.dll_path (cherry picked from commit 221fd84703c545408bbb4a6e0b58459651331f5c) * bpo-38234: Fix test_embed pathconfig tests (GH-16390) bpo-38234: On macOS and FreeBSD, the temporary directory can be symbolic link. For example, /tmp can be a symbolic link to /var/tmp. Call realpath() to resolve all symbolic links. (cherry picked from commit 00508a7407d7d300b487532e2271534b20e378a7) * bpo-38234: Add test_init_setpath_config() to test_embed (GH-16402) * Add test_embed.test_init_setpath_config(): test Py_SetPath() with PyConfig. * test_init_setpath() and test_init_setpythonhome() no longer call Py_SetProgramName(), but use the default program name. * _PyPathConfig: isolated, site_import and base_executable fields are now only available on Windows. * If executable is set explicitly in the configuration, ignore calculated base_executable: _PyConfig_InitPathConfig() copies executable to base_executable. * Complete path config documentation. (cherry picked from commit 8bf39b606ef7b02c0279a80789f3c4824b0da5e9) * bpo-38234: Complete init config documentation (GH-16404) (cherry picked from commit 88feaecd46a8f427e30ef7ad8cfcddfe392a2402) * bpo-38234: Fix test_embed.test_init_setpath_config() on FreeBSD (GH-16406) Explicitly preinitializes with a Python preconfiguration to avoid Py_SetPath() implicit preinitialization with a compat preconfiguration. Fix also test_init_setpath() and test_init_setpythonhome() on macOS: use self.test_exe as the executable (and base_executable), rather than shutil.which('python3'). (cherry picked from commit 49d99f01e6e51acec5ca57a02e857f0796bc418b) * bpo-38234: Py_Initialize() sets global path configuration (GH-16421) * Py_InitializeFromConfig() now writes PyConfig path configuration to the global path configuration (_Py_path_config). * Add test_embed.test_get_pathconfig(). * Fix typo in _PyWideStringList_Join(). (cherry picked from commit 12f2f177fc483723406d7917194e7f655a20631b)
* [3.8] closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16409)Benjamin Peterson2019-09-2619-4835/+3972
| | | | 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)
* [3.8] bpo-22273: Changed conditions for ctypes array-in-struct handling. ↵Vinay Sajip2019-09-251-7/+4
| | | | | (GH-16381) (GH-16401) (cherry picked from commit c64af8fad3c4f5751af624647fbb0ce023f525dc)
* bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330) ↵Miss Islington (bot)2019-09-251-7/+8
| | | | | | | (GH-16383) (cherry picked from commit edad4d89e357c92f70c0324b937845d652b20afd) Co-authored-by: Yury Selivanov <yury@edgedb.com>
* bpo-22273: Update ctypes to correctly handle arrays in small structur… ↵Miss Islington (bot)2019-09-252-0/+146
| | | | | (GH-15839) (GH-16370) (cherry picked from commit 12f209eccb1587e8c98057d9c5f865c21f4a16c1)
* bpo-38234: read_pth_file() now returns PyStatus (GH-16338)Miss Islington (bot)2019-09-231-79/+112
| | | | | | | | | | | | Refactor path configuration code: * read_pth_file() now returns PyStatus to report errors, rather than calling Py_FatalError(). * Move argv0_path and zip_path buffers out of PyCalculatePath structures. * On Windows, _PyPathConfig.home is now preferred over PyConfig.home. (cherry picked from commit 85ce0a7178801b538160cbb5cf9ef50a713c45bf) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335) (GH-16336)Victor Stinner2019-09-231-62/+78
| | | | | | | | | | | | | | | | | | * _PyConfig_InitPathConfig() now starts by copying the global path configuration, and then override values set in PyConfig. * _PyPathConfig_Calculate() implementations no longer override _PyPathConfig fields which are already computed. For example, if _PyPathConfig.prefix is not NULL, leave it unchanged. * If Py_SetPath() has been called, _PyConfig_InitPathConfig() doesn't call _PyPathConfig_Calculate() anymore. * _PyPathConfig_Calculate() no longer uses PyConfig, except to initialize PyCalculatePath structure. * pathconfig_calculate(): remove useless temporary "_PyPathConfig new_config" variable. * calculate_module_search_path(): remove hack to workaround memory allocation failure, call Py_FatalError() instead. * Fix get_program_full_path(): handle memory allocation failure. (cherry picked from commit 9c42f8cda552694f3b47d6388d4ae84d61731872)
* [3.8] bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) ↵Victor Stinner2019-09-211-4/+6
| | | | | | | | | | | | | | | | | | | | | | | | | (GH-16313) * bpo-38234: Remove _PyPathConfig.dll_path (GH-16307) The DLL path is not computed from any user configuration and cannot be configured by PyConfig. Instead, add a new _Py_dll_path global variable. Remove _PyConfig_SetPathConfig(): replaced with _PyPathConfig_Init(). Py_Initialize() now longer sets the "global path configuration", but only initialize _Py_dll_path. (cherry picked from commit c422167749f92d4170203e996a2c619c818335ea) * bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298) * If Py_SetPath() has been called, _PyConfig_InitPathConfig() now uses its value. * Py_Initialize() now longer copies path configuration from PyConfig to the global path configuration (_Py_path_config). (cherry picked from commit e267793aa4101b2771ed0e66aaff5743d23f59af)
* 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>
* bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)Miss Islington (bot)2019-09-161-1/+1
| | | | | | | | ``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>
* bpo-38153: detect shake independently from sha3 (GH-16143)Miss Islington (bot)2019-09-161-2/+11
| | | | | | | | XOF digests (SHAKE) are not available in OpenSSL 1.1.0 but SHA3 fixed-length digests are. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit eb2b0c694aef6122fdf95015abb24e0d095b6401) Co-authored-by: Christian Heimes <christian@python.org>
* [3.8] bpo-38153: Normalize hashlib algorithm names (GH-16083) (GH-16144)Christian Heimes2019-09-161-21/+146
| | | | | | Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 995b5d38e7cc24cac3de8dfd516115f86b0bcf80) Co-authored-by: Christian Heimes <christian@python.org>
* [3.8] bpo-38168: Fix a possbile refleak in setint() of mmapmodule.c ↵Miss Islington (bot)2019-09-161-1/+2
| | | | | | | | | | | | | | (GH-16136) (GH-16174) (cherry picked from commit 56a45142e70a1ccf3233d43cb60c47255252e89a) Co-authored-by: Hai Shi <shihai1992@gmail.com> https://bugs.python.org/issue38168 Automerge-Triggered-By: @zhangyangyu
* bpo-37798: Prevent undefined behavior in direct calls to the C helper ↵Miss Islington (bot)2019-09-151-1/+17
| | | | | | | function. (GH-16149) (GH-16160) (cherry picked from commit 6e27a0d77520bf2c4412e367496212510f81b983) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.8] bpo-38005: Fixed comparing and creating of InterpreterID and ↵Serhiy Storchaka2019-09-141-85/+65
| | | | | | | | | | | | | | ChannelID. (GH-15652) (GH-16145) * Fix a crash in comparing with float (and maybe other crashes). * They are now never equal to strings and non-integer numbers. * Comparison with a large number no longer raises OverflowError. * Arbitrary exceptions no longer silenced in constructors and comparisons. * TypeError raised in the constructor contains now the name of the type. * Accept only ChannelID and int-like objects in channel functions. * Accept only InterpreterId, int-like objects and str in the InterpreterId constructor. * Accept int-like objects, not just int in interpreter related functions. (cherry picked from commit bf169915ecdd42329726104278eb723a7dda2736)
* [3.8] bpo-37206: Unrepresentable default values no longer represented as ↵Serhiy Storchaka2019-09-1426-202/+200
| | | | | | | | | | None. (GH-13933) (GH-16141) In ArgumentClinic, value "NULL" should now be used only for unrepresentable default values (like in the optional third parameter of getattr). "None" should be used if None is accepted as argument and passing None has the same effect as not passing the argument at all. (cherry picked from commit 279f44678c8b84a183f9eeb85e0b086228154497) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.8] bpo-38150: Fix refleak in the finalizer of a _testcapimodule type ↵Stéphane Wirtel2019-09-131-5/+13
| | | | | | | | | | | | (GH-16115) (GH-16118) The PyLong created in the finalizer was not being cleaned up https://bugs.python.org/issue38150 Automerge-Triggered-By: @matrixise (cherry picked from commit a67ac2f2d9550e5a36d28f9b6eeacf6575dda2d5) Co-authored-by: Eddie Elizondo <eelizondo@fb.com>