summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-36251: Fix format strings used in match_repr() and stdprinter_repr(). ↵Miss Islington (bot)2019-03-101-1/+1
| | | | | | | (GH-12252) (cherry picked from commit 8b91edadc06dcb0d391a65d1ecdf07dcb429df1b) Co-authored-by: sth <sth.dev@tejp.de>
* bpo-36209: Fix typo on hashlib error message (GH-12194)Miss Islington (bot)2019-03-061-1/+1
| | | | | (cherry picked from commit b71e28ea91259ca3914e2ff84fc126795ea6b848) Co-authored-by: Emmanuel Arias <emmanuelarias30@gmail.com>
* bpo-36179: Fix ref leaks in _hashopenssl (GH-12158)Miss Islington (bot)2019-03-041-5/+7
| | | | | | | | | | | Fix two unlikely reference leaks in _hashopenssl. The leaks only occur in out-of-memory cases. Thanks to Charalampos Stratakis. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue36179 (cherry picked from commit b7bc283ab6a23ee98784400ebffe7fe410232a2e) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-28441: Ensure `.exe` suffix in `sys.executable` on MinGW and Cygwin ↵Miss Islington (bot)2019-02-271-0/+45
| | | | | | | | | | | | | | | | | | | | | (GH-4348) This is needed to even the run the test suite on buildbots for affected platforms; e.g.: ``` ./python.exe ./Tools/scripts/run_tests.py -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 /home/embray/src/python/test-worker/3.x.test-worker/build/python -u -W default -bb -E -W error::BytesWarning -m test -r -w -j 1 -u all -W --slowest --fail-env-changed --timeout=11700 -j2 Traceback (most recent call last): File "./Tools/scripts/run_tests.py", line 56, in <module> main(sys.argv[1:]) File "./Tools/scripts/run_tests.py", line 52, in main os.execv(sys.executable, args) PermissionError: [Errno 13] Permission denied make: *** [Makefile:1073: buildbottest] Error 1 ``` (cherry picked from commit 7a7693e9cb12e5571c76331db56a28eef9acb6e0) Co-authored-by: E. M. Bray <erik.m.bray@gmail.com>
* bpo-36106: Resolve sinpi name clash with libm (IEEE-754 violation). (GH-12027)Miss Islington (bot)2019-02-261-4/+4
| | | | | | | | | | | The standard math library (libm) may follow IEEE-754 recommendation to include an implementation of sinPi(), i.e. sinPi(x):=sin(pi*x). And this triggers a name clash, found by FreeBSD developer Steve Kargl, who worken on putting sinpi into libm used on FreeBSD (it has to be named "sinpi", not "sinPi", cf. e.g. https://en.cppreference.com/w/c/experimental/fpext4). (cherry picked from commit f57cd8288dbe6aba99c057f37ad6d58f8db75350) Co-authored-by: Dima Pasechnik <dimpase@gmail.com>
* bpo-24643: Fix "GH-define timezone _timezone" clashes on Windows (GH-12019)Miss Islington (bot)2019-02-261-5/+15
| | | | | (cherry picked from commit 6673decfa0fb078f60587f5cb5e98460eea137c2) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* fix _abc.c compile error on Cygwin (GH-8445)Miss Islington (bot)2019-02-241-1/+1
| | | | | (cherry picked from commit abe5922743f62e130c4dad2f637274c38d6b1e8b) Co-authored-by: E. M. Bray <erik.m.bray@gmail.com>
* bpo-34572: change _pickle unpickling to use import rather than retrieving ↵Miss Islington (bot)2019-02-181-6/+6
| | | | | | | | from sys.modules (GH-9047) (GH-11921) Fix C implementation of pickle.loads to use importlib's locking mechanisms, and thereby avoid using partially-loaded modules. (cherry picked from commit 4371c0a9c0848f7a0947d43f26f234842b41efdf) Co-authored-by: tjb900 <ozburgess@gmail.com>
* bpo-34294: re module, fix wrong capturing groups in rare cases. (GH-11546)Miss Islington (bot)2019-02-182-1/+9
| | | | | | | | Need to reset capturing groups between two SRE(match) callings in loops, this fixes wrong capturing groups in rare cases. Also add a missing index in re.rst. (cherry picked from commit 4a7f44a2ed49ff1e87db062e7177a56c6e4bbdb0) Co-authored-by: animalize <animalize@users.noreply.github.com>
* bpo-35942: Improve the error message if __fspath__ returns invalid types in ↵Miss Islington (bot)2019-02-181-8/+15
| | | | | | | | path_converter (GH-11831) The error message emitted when returning invalid types from __fspath__ in interfaces that allow passing PathLike objects has been improved and now it does explain the origin of the error. (cherry picked from commit 09fbcd6085e18b534fd4161844ff39f77eb4a082) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* closes bpo-35991: Fix a potential double free in Modules/_randommodule.c. ↵Miss Islington (bot)2019-02-141-1/+0
| | | | | | | (GH-11849) (cherry picked from commit bb3c05d7efca8d23bf39bc2640297ba2598899f3) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] Remove stray quote in os.replace docstring. (GH-11835)Benjamin Peterson2019-02-132-4/+4
| | | | | (cherry picked from commit 73d600239b0aa34198bce2b7982e4ff14c92f119) Co-authored-by: Anthony Sottile <asottile@umich.edu>
* lru_cache: Add more comments. Fix comment typos. Clarify a comment. ↵Miss Islington (bot)2019-02-091-4/+25
| | | | (GH-11795) (GH-11798)
* bpo-29734: nt._getfinalpathname handle leak (GH-740)Miss Islington (bot)2019-02-021-8/+10
| | | | | | Make sure that failure paths call CloseHandle outside of the function that failed (cherry picked from commit b82bfac4369c0429e562a834b3752e66c4821eab) Co-authored-by: Mark Becwar <mark@thebecwar.com>
* Consistently move the misses update to just before the user function call ↵Miss Islington (bot)2019-01-311-3/+5
| | | | (GH-11715) (GH-11716)
* bpo-35847: RISC-V needs CTYPES_PASS_BY_REF_HACK (GH-11694)Miss Islington (bot)2019-01-291-1/+1
| | | | | | | | This fixes the ctypes.test.test_structures.StructureTestCase test. https://bugs.python.org/issue35847 (cherry picked from commit 742d768656512a469ce9571b1cbd777def7bc5ea) Co-authored-by: Andreas Schwab <schwab@linux-m68k.org>
* bpo-35780: Fix errors in lru_cache() C code (GH-11623) (GH-11682)Miss Islington (bot)2019-01-261-84/+188
|
* bpo-35720: Fixing a memory leak in pymain_parse_cmdline_impl() (GH-11528)Miss Islington (bot)2019-01-221-0/+1
| | | | | | | | | When the loop in the pymain_read_conf function in this same file calls pymain_init_cmdline_argv() a 2nd time, the pymain->command buffer of wchar_t is overriden and the previously allocated memory is never freed. (cherry picked from commit 35ca1820e19f81f69073f294503cdcd708fe490f) Co-authored-by: Lucas Cimon <lucas.cimon@gmail.com>
* bpo-35746: Fix segfault in ssl's cert parser (GH-11569)Miss Islington (bot)2019-01-151-0/+4
| | | | | | | | | | | | Fix a NULL pointer deref in ssl module. The cert parser did not handle CRL distribution points with empty DP or URI correctly. A malicious or buggy certificate can result into segfault. Signed-off-by: Christian Heimes <christian@python.org> https://bugs.python.org/issue35746 (cherry picked from commit a37f52436f9aa4b9292878b72f3ff1480e2606c3) Co-authored-by: Christian Heimes <christian@python.org>
* bpo-35066: _dateime.datetime.strftime copies trailing '%' (GH-10692)Miss Islington (bot)2019-01-141-5/+8
| | | | | | | | | | Previously, calling the strftime() method on a datetime object with a trailing '%' in the format string would result in an exception. However, this only occured when the datetime C module was being used; the python implementation did not match this behavior. Datetime is now PEP-399 compliant, and will not throw an exception on a trailing '%'. (cherry picked from commit 454b3d4ea246e8751534e105548d141ed7b0b032) Co-authored-by: MichaelSaah <mike.saah@gmail.com>
* bpo-32710: Fix _overlapped.Overlapped memory leaks (GH-11489)Miss Islington (bot)2019-01-111-24/+54
| | | | | | | | | | | | | | | Fix memory leaks in asyncio ProactorEventLoop on overlapped operation failures. Changes: * Implement the tp_traverse slot in the _overlapped.Overlapped type to help to break reference cycles and identify referrers in the garbage collector. * Always clear overlapped on failure: not only set type to TYPE_NOT_STARTED, but release also resources. (cherry picked from commit 5485085b324a45307c1ff4ec7d85b5998d7d5e0d) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-32710: Fix leak in Overlapped_WSASend() (GH-11469)Miss Islington (bot)2019-01-081-0/+2
| | | | | | | | Fix a memory leak in asyncio in the ProactorEventLoop when ReadFile() or WSASend() overlapped operation fail immediately: release the internal buffer. (cherry picked from commit a234e148394c2c7419372ab65b773d53a57f3625) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* closes bpo-35643: Fix a SyntaxWarning: invalid escape sequence in ↵Miss Islington (bot)2019-01-021-1/+1
| | | | | | | Modules/_sha3/cleanup.py (GH-11411) (cherry picked from commit d466c43e55cd32af84e353f0e9a48b09b7534f61) Co-authored-by: Mickaël Schoentgen <contact@tiger-222.fr>
* [3.7] bpo-35214: Annotate posix calls for clang MSan. (GH-11389) (GH-11391)Gregory P. Smith2018-12-311-0/+13
| | | | | | | It doesn't know the details of a few less common libc functions.. (cherry picked from commit 1d300ce1d8238136595c8fea76266a4755cd73a2) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
* bpo-35550: Fix incorrect Solaris define guards (GH-11275)Miss Islington (bot)2018-12-314-5/+5
| | | | | | | | | | Python source code uses on several places ifdef sun or defined(sun) without the underscores, which is not standard compliant and shouldn't be used. Defines should check for __sun instead. Reference: http://nadeausoftware.com/articles/2012/01/c_c_tip_how_use_compiler_predefined_macros_detect_operating_systemGH-Solaris https://bugs.python.org/issue35550 (cherry picked from commit 6f9bc72c79c3262e5d0f2c0e96b016477399cfb1) Co-authored-by: Jakub Kulík <Kulikjak@gmail.com>
* bpo-28503: Use crypt_r() when available instead of crypt() (GH-11373) (GH-11376)Miss Islington (bot)2018-12-311-1/+9
| | | | | | | | Use crypt_r() when available instead of crypt() in the crypt module. As a nice side effect: This also avoids a memory sanitizer flake as clang msan doesn't know about crypt's internal libc allocated buffer. (cherry picked from commit 387512c7ecde6446f2e29408af2e16b9fc043807) Co-authored-by: Gregory P. Smith <greg@krypto.org> [Google]
* bpo-35214: MSan workarounds for socket, time, and test_faulthandler. ↵Miss Islington (bot)2018-12-312-0/+27
| | | | | | | | | | (GH-11375) (GH-11378) Add Clang Memory Sanitizer build instrumentation to work around false positives from the socket and time modules as well as skipping a couple test_faulthandler tests. (cherry picked from commit b474e6774d60fa67d5373e361a0ed53c18b24f53) Co-authored-by: Gregory P. Smith <greg@krypto.org>
* bpo-35529: Fix a reference counting bug in PyCFuncPtr_FromDll(). (GH-11229)Miss Islington (bot)2018-12-201-5/+8
| | | | | | | "dll" would leak if an error occurred in _validate_paramflags() or GenericPyCData_new(). (cherry picked from commit d77d97c9a1f593fe161afab97e2a3e2292ab88b9) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35502: Fix reference leaks in ElementTree.TreeBuilder. (GH-11170)Miss Islington (bot)2018-12-181-0/+5
| | | | | (cherry picked from commit d2a75c67830d7c9f59e4e9b60f36974234c829ef) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. ↵Miss Islington (bot)2018-12-176-0/+32
| | | | | | | (GH-11175) (cherry picked from commit 842acaab1376c5c84fd5966bb6070e289880e1ca) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-35489: Use "const Py_UNICODE *" for the Py_UNICODE converter in ↵Serhiy Storchaka2018-12-146-22/+26
| | | | | | AC. (GH-11150). (GH-11151) (cherry picked from commit afb3e71a1710c444fbe789b51df43ee16ee9ede7)
* [3.7] bpo-31446: Copy command line that should be passed to ↵Serhiy Storchaka2018-12-142-8/+26
| | | | | | | CreateProcessW(). (GH-11141). (GH-11149) (cherry picked from commit 7b36016a15aeed0d76a4c05a66203e6d7723aace) Co-authored-by: Vladimir Matveev <v2matveev@outlook.com>
* bpo-35444: Fix error handling when fail to look up builtin "getattr". ↵Serhiy Storchaka2018-12-111-6/+2
| | | | | (GH-11047) (GH-11107) (cherry picked from commit bb86bf4c4eaa30b1f5192dab9f389ce0bb61114d)
* bpo-35454: Fix miscellaneous minor issues in error handling. (GH-11077)Miss Islington (bot)2018-12-113-8/+17
| | | | | | | | * bpo-35454: Fix miscellaneous minor issues in error handling. * Fix a null pointer dereference. (cherry picked from commit 8905fcc85a6fc3ac394bc89b0bbf40897e9497a6) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-31374: expat doesn't include <pyconfig.h> on Windows (GH-11079)Miss Islington (bot)2018-12-101-1/+3
| | | | | (cherry picked from commit b6ef6f69a9afc979640a5f9883f799de1364bff7) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-31374: Include pyconfig.h earlier in expat (GH-11064)Miss Islington (bot)2018-12-101-0/+1
| | | | | | | | | Include <pyconfig.h> ealier in Modules/expat/xmltok.c to define properly _POSIX_C_SOURCE. Python defines _POSIX_C_SOURCE as 200809L, whereas <features.h> (included indirectly by <string.h>) defines _POSIX_C_SOURCE as 199506L. (cherry picked from commit cf247359d5b7082044eea1fa94b5211a172b1ff6) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-35050: AF_ALG length check off-by-one error (GH-10058) (GH-11069)Victor Stinner2018-12-101-3/+7
| | | | | | | | | The length check for AF_ALG salg_name and salg_type had a off-by-one error. The code assumed that both values are not necessarily NULL terminated. However the Kernel code for alg_bind() ensures that the last byte of both strings are NULL terminated. Signed-off-by: Christian Heimes <christian@python.org> (cherry picked from commit 2eb6ad8578fa9d764c21a92acd8e054e3202ad19)
* bpo-35441: Remove dead and buggy code related to PyList_SetItem(). (GH-11033)Miss Islington (bot)2018-12-084-24/+15
| | | | | | | | | | | | In _localemodule.c and selectmodule.c, remove dead code that would cause double decrefs if run. In addition, replace PyList_SetItem() with PyList_SET_ITEM() in cases where a new list is populated and there is no possibility of an error. In addition, check if the list changed size in the loop in array_array_fromlist(). (cherry picked from commit 99d56b53560b3867844472ae381fb3f858760621) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-22005: Fixed unpickling instances of datetime classes pickled by ↵Serhiy Storchaka2018-12-071-78/+169
| | | | | | | Python 2. (GH-11017) (GH-11022) encoding='latin1' should be used for successful decoding. (cherry picked from commit 8452ca15f41061c8a6297d7956df22ab476d4df4)
* bpo-35436: Add missing PyErr_NoMemory() calls and other minor bug fixes. ↵Zackery Spytz2018-12-077-12/+39
| | | | | (GH-11015) (GH-11020) (cherry picked from commit 4c49da0cb7434c676d70b9ccf38aca82ac0d64a9)
* bpo-35384: The repr of ctypes.CArgObject no longer fails for non-ascii ↵Miss Islington (bot)2018-12-061-4/+22
| | | | | | | character. (GH-10863) (cherry picked from commit 3ffa8b9ba190101f674a0e524e482a83ed09cccd) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-35310: Clear select() lists before returning upon EINTR (GH-10877)Miss Islington (bot)2018-12-051-0/+4
| | | | | | | | | select() calls are retried on EINTR (per PEP 475). However, if a timeout was provided and the deadline has passed after running the signal handlers, rlist, wlist and xlist should be cleared since select(2) left them unmodified. (cherry picked from commit 7f52415a6d4841d77d3b7853e83b25a22e0048dc) Co-authored-by: Oran Avraham <252748+oranav@users.noreply.github.com>
* bpo-34604: Use %R because of invisible characters or trailing whitespaces. ↵Serhiy Storchaka2018-12-052-2/+2
| | | | | | | (GH-9165). (GH-10947) (cherry picked from commit 34c7f0c04e2b4e715b2c3df1875af8939fbe7d0b) Co-authored-by: William Grzybowski <wg@FreeBSD.org>
* bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. ↵Serhiy Storchaka2018-12-051-17/+13
| | | | | | | (GH-8113). (GH-10946) (cherry picked from commit 5b25f1d03100e2283c1b129d461ba68ac0169a14) Co-authored-by: Sergey Fedoseev <fedoseev.sergey@gmail.com>
* bpo-34987: Fix a possible null pointer dereference in _pickle.c's ↵Miss Islington (bot)2018-12-051-1/+4
| | | | | | | save_reduce(). (GH-9886) (cherry picked from commit 25d389789c59a52a31770f7c50ce9e02a8909190) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-35373: Fix PyInit_timezone() error handling (GH-10864)Victor Stinner2018-12-031-5/+24
| | | | | | | | | | | | | | | | | | * bpo-35373: Fix PyInit_timezone() error handling PyInit_timezone() now returns -1 at exit if an exception is raised. Check also explicitly PyUnicode_DecodeLocale() and Py_BuildValue() errors. * bpo-35373: Fix PyInit_time() error handling (GH-10865) * PyInit_time() now returns NULL if an exception is raised. * Rename PyInit_timezone() to init_timezone(). "PyInit_" prefix is a special prefix for function initializing a module. init_timezone() doesn't initialize a module and the function is not exported. (cherry picked from commit 3bb150d8148e3cc08418077a58f43e064b9fde61)
* bpo-10320: Replace nonstandard sprintf() length modifier in ctypes' ↵Miss Islington (bot)2018-12-031-1/+1
| | | | | | | | PyCArg_repr(). (GH-10853) Use "ll" instead of the nonstandard "q". (cherry picked from commit 062cbb67726f26794b1b461853e40696b4a0b220) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35371: Fix possible crash in os.utime() on Windows. (GH-10844)Miss Islington (bot)2018-12-011-22/+15
| | | | | (cherry picked from commit 32bc11c33cf5ccea165b5f4ac3799f02fdf9c76a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* get_gmtoff() now returns time_t (GH-10838) (GH-10839)Victor Stinner2018-12-011-9/+29
| | | | | | | | | get_gmtoff() now returns time_t instead of int to fix the following Visual Studio warning: Modules\timemodule.c(1183): warning C4244: 'return': conversion from 'time_t' to 'int', possible loss of data (cherry picked from commit 503ce5c482cb267b0770bc46c315d5cf822bdca9)
* bpo-35336: Fix PYTHONCOERCECLOCALE=1 (GH-10806) (GH-10813)Victor Stinner2018-11-301-2/+8
| | | | | | Fix PYTHONCOERCECLOCALE=1 environment variable: only coerce the C locale if the LC_CTYPE locale is "C". (cherry picked from commit 55e498058faf8c97840556f6d791c2c392732dc3)