summaryrefslogtreecommitdiff
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-37731: Reorder includes in xmltok.c to avoid redefinition of ↵Pablo Galindo2019-10-121-8/+8
| | | | _POSIX_C_SOURCE (GH-16733)
* bpo-38437: Activate GC_DEBUG when PY_DEBUG is set (GH-16707)Pablo Galindo2019-10-101-2/+5
|
* bpo-38282: Rewrite getsockaddrarg() helper function (GH-16698)Victor Stinner2019-10-102-39/+25
| | | | | | | | Rewrite getsockaddrarg() helper function of socketmodule.c (_socket module) to prevent a false alarm when compiling codde using GCC with _FORTIFY_SOURCE=2. Pass a pointer of the sock_addr_t union, rather than passing a pointer to a sockaddr structure. Add "struct sockaddr_tipc tipc;" to the sock_addr_t union.
* bpo-38353: Fix typos in calculate_argv0_path_framework() (GH-16695)Victor Stinner2019-10-101-4/+4
| | | | | bpo-38353, bpo-38429: Fix typos introduced by commit c02b41b1fb115c87693530ea6a480b2e15460424 in calculate_argv0_path_framework() of getpath.c.
* bpo-38392: Only declare visit_validate() if Py_DEBUG is defined (GH-16689)Victor Stinner2019-10-101-0/+3
| | | | | bpo-38392, bpo-38426: Fix a compiler warning in gcmodule.c. Fix also a typo in PYMEM_DEADBYTE macro comment.
* bpo-38379: don't claim objects are collected when they aren't (#16658)Tim Peters2019-10-091-6/+4
| | | | | | * bpo-38379: when a finalizer resurrects an object, nothing is actually collected in this run of gc. Change the stats to relect that truth.
* closes bpo-36161: Use thread-safe ttyname_r instead of ttyname. (GH-14868)Antonio Gutierrez2019-10-081-4/+15
| | | Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
* bpo-38368: Added fix for ctypes crash when handling arrays in structs… ↵Vinay Sajip2019-10-082-25/+179
| | | | (GH-16589)
* bpo-38371: Tkinter: deprecate the split() method. (GH-16584)Serhiy Storchaka2019-10-081-0/+6
|
* closes bpo-38402: Check error of primitive crypt/crypt_r. (GH-16599)Antonio Gutierrez2019-10-071-0/+3
| | | | | | | Checks also for encryption algorithms methods not supported in different OSs. Signed-off-by: Antonio Gutierrez <chibby0ne@gmail.com>
* bpo-38070: Enhance visit_decref() debug trace (GH-16631)Victor Stinner2019-10-081-4/+5
| | | | | | | | 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.
* bpo-38392: PyObject_GC_Track() validates object in debug mode (GH-16615)Victor Stinner2019-10-083-4/+24
| | | | | | | | In debug mode, PyObject_GC_Track() now calls tp_traverse() of the object type to ensure that the object is valid: test that objects visited by tp_traverse() are valid. Fix pyexpat.c: only track the parser in the GC once the parser is fully initialized.
* bpo-36389: _PyObject_CheckConsistency() available in release mode (GH-16612)Victor Stinner2019-10-072-1/+9
| | | | | | | | | | | | | | | | | | | | | 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.
* bpo-36356: Fix memory leak in _asynciomodule.c (GH-16598)Ben Harper2019-10-071-0/+7
|
* Fix a compile warning in selectmodule.c. (GH-16617)Xiang Zhang2019-10-071-1/+1
|
* bpo-38353: Simplify calculate_pybuilddir() (GH-16614)Victor Stinner2019-10-071-5/+0
| | | | Calling _Py_wfopen() is enough to check if filename is an existing file or not. There is no need to check first isfile().
* bpo-38353: getpath.c: allocates strings on the heap (GH-16585)Victor Stinner2019-10-041-295/+383
| | | | | | | | | | | * _Py_FindEnvConfigValue() now returns a string allocated by PyMem_RawMalloc(). * calculate_init() now decodes VPATH macro. * Add calculate_open_pyenv() function. * Add substring() and joinpath2() functions. * Fix add_exe_suffix() And a few cleanup changes.
* bpo-38353: getpath.c uses dynamically allocated strings (GH-16582)Victor Stinner2019-10-041-91/+115
| | | | * PyCalculatePath: add "_macro" to the 3 fields storing macro values * Add dynamically allocated strings to PyCalculatePath
* bpo-13153: Use OS native encoding for converting between Python and Tcl. ↵Serhiy Storchaka2019-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).
* bpo-38353: Rework ismodule() in getpath.c (GH-16574)Victor Stinner2019-10-041-64/+80
| | | | * ismodule() no longer modify the input string. * copy_absolute(), joinpath(): rename parameters and local variables.
* bpo-38353: Add subfunctions to getpath.c (GH-16572)Victor Stinner2019-10-041-153/+259
| | | | | | | | | | | | | | Following symbolic links is now limited to 40 attempts, just to prevent loops. Add subfunctions: * Add resolve_symlinks() * Add calculate_argv0_path_framework() * Add calculate_which() * Add calculate_program_macos() Fix also _Py_wreadlink(): readlink() result type is Py_ssize_t, not int.
* bpo-38353: Fix calculate_argv0_path() for symlinks (GH-16549)Victor Stinner2019-10-031-1/+1
| | | | calculate_argv0_path() must read argv0_path link, not read program_full_path link.
* bpo-38353: Cleanup includes in the internal C API (GH-16548)Victor Stinner2019-10-021-0/+1
| | | | Use forward declaration of types to avoid includes in the internal C API. Add also comment to justify other includes.
* bpo-37474: Don't call fedisableexcept() on FreeBSD (GH-16515)Victor Stinner2019-10-011-13/+0
| | | | | On FreeBSD, Python no longer calls fedisableexcept() at startup to control the floating point control mode. The call became useless since FreeBSD 6: it became the default mode.
* bpo-38321: Fix compiler warning in _randommodule.c (GH-16512)Victor Stinner2019-10-011-1/+1
| | | | Fix the GCC warning: "initialization discards ‘const’ qualifier from pointer target type".
* bpo-38304: PyConfig_InitPythonConfig() cannot fail anymore (GH-16509)Victor Stinner2019-10-011-5/+1
| | | | PyConfig_InitPythonConfig() and PyConfig_InitIsolatedConfig() no longer return PyStatus: they cannot fail anymore.
* bpo-38304: Remove PyConfig.struct_size (GH-16500) (GH-16508)Victor Stinner2019-10-011-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. (cherry picked from commit bdace21b769998396d0ccc8da99a8ca9b507bfdf)
* bpo-38321: Fix _testcapimodule.c warning (GH-16494)Victor Stinner2019-09-301-2/+2
| | | | | | | Fix the following warning: modules\_testcapimodule.c(6409): warning C4146: unary minus operator applied to unsigned type, result still unsigned
* Clear weakrefs in garbage found by the GC (#16495)Neil Schemenauer2019-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.
* bpo-38321: Fix PyCStructUnionType_update_stgdict() warning (GH-16492)Victor Stinner2019-09-301-1/+1
| | | | | | 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
* bpo-38321: Fix _asynciomodule.c compiler warning (GH-16493)Victor Stinner2019-09-301-1/+0
| | | | | | | | | 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.
* bpo-38304: Add PyConfig.struct_size (GH-16451)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.
* bpo-38270: More fixes for strict crypto policy (GH-16418)Christian Heimes2019-09-271-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
* closes bpo-38174: Update vendored expat library to 2.2.8. (GH-16346)Benjamin Peterson2019-09-2519-4836/+3973
| | | Fixes CVE-2019-15903. See full changelog at https://github.com/libexpat/libexpat/blob/R_2_2_8/expat/Changes.
* bpo-38142: Updated _hashopenssl.c to be PEP 384 compliant (#16071)Christian Heimes2019-09-251-54/+68
| | | | * Updated _hashopenssl.c to be PEP 384 compliant * Remove refleak test from test_hashlib. The updated type no longer accepts random arguments to __init__.
* bpo-38248: Fix inconsistent immediate asyncio.Task cancellation (GH-16330)Yury Selivanov2019-09-251-7/+8
|
* Changed conditions for ctypes array-in-struct handling. (GH-16381)Vinay Sajip2019-09-251-7/+4
|
* bpo-22273: Disabled tests while investigating buildbot failures on ↵Vinay Sajip2019-09-251-1/+1
| | | | ARM7L/PPC64. (GH-16377)
* bpo-38265: Update os.pread to accept the length type as Py_ssize_t. (GH-16359)Dong-hee Na2019-09-252-10/+17
|
* bpo-22273: Update ctypes to correctly handle arrays in small structur… ↵Vinay Sajip2019-09-252-0/+146
| | | | (GH-15839)
* bpo-38234: Cleanup getpath.c (GH-16367)Victor Stinner2019-09-251-73/+116
| | | | | | | | | * 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
* bpo-38234: Add tests for Python init path config (GH-16358)Victor Stinner2019-09-241-3/+3
|
* bpo-38234: read_pth_file() now returns PyStatus (GH-16338)Victor Stinner2019-09-241-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.
* bpo-38234: Fix _PyConfig_InitPathConfig() (GH-16335)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.
* bpo-38234: Fix PyConfig_Read() when Py_SetPath() was called (GH-16298)Victor Stinner2019-09-211-4/+6
| | | | | | * 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).
* bpo-6559: Update _posixsubprocess.fork_exec doc (GH-16283)Orivej Desh2019-09-201-4/+7
| | | | | | | | | | It did not list the argument added in d4cc7bf993eda4149a05ed25f2f33e18e43fd7c1. https://bugs.python.org/issue6559 Automerge-Triggered-By: @gpshead
* bpo-38140: Make dict and weakref offsets opaque for C heap types (#16076)Eddie Elizondo2019-09-192-1/+119
| | | | | | * Make dict and weakref offsets opaque for C heap types * Add news
* bpo-38203: faulthandler.dump_traceback_later() is always available (GH-16249)Victor Stinner2019-09-181-17/+0
| | | | dump_traceback_later() and cancel_dump_traceback_later() functions of the faulthandler module are always available since Python 3.7.
* bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. ↵Serhiy Storchaka2019-09-171-31/+31
| | | | (GH-16190)
* bpo-33936: Don't call obsolete init methods with OpenSSL 1.1.0+ (GH-16140)Christian Heimes2019-09-161-1/+1
| | | | | | ``OPENSSL_VERSION_1_1`` was never defined in ``_hashopenssl.c``. https://bugs.python.org/issue33936