summaryrefslogtreecommitdiff
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* 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-07-016-32/+21
| | | | | (cherry picked from commit 3b03b09fc94425915c5b1225e9200a3a95bc827b) Co-authored-by: Benjamin Peterson <benjamin@python.org>
* bpo-32627: Fix compile error when conflicting `_uuid` headers included ↵Miss Islington (bot)2019-07-011-3/+6
| | | | | | | (GH-11751) (cherry picked from commit 6ffd9b05dfade9e3a101fe039157856eb855f82e) Co-authored-by: ziheng <zihenglv@gmail.com>
* 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-1110-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-101-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-271-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
|
* bpo-36734: Fix compilation of faulthandler.c on HP-UX (GH-12970)Miss Islington (bot)2019-04-301-1/+2
| | | | | | Initialize "stack_t current_stack" to zero using memset(). (cherry picked from commit b84cb70880a0acfcbbaca7bcda405af08f94d269) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-2091: Fix typo in exception message (GH-12987)Miss Islington (bot)2019-04-271-1/+1
| | | | | (cherry picked from commit 21a9ba1992775b5a833da28bfa0a9f028d1b6761) Co-authored-by: Berker Peksag <berker.peksag@gmail.com>
* bpo-18372: Add missing PyObject_GC_Track() calls in the pickle module (GH-8505)Miss Islington (bot)2019-04-231-0/+3
| | | | | (cherry picked from commit 359bd4f61b9e1493081f4f67882554247b53926a) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* [3.7] bpo-9566: Fix compiler warnings on Windows (GH-12920)Victor Stinner2019-04-231-4/+20
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | * bpo-9566: Fix compiler warnings in gcmodule.c (GH-11010) Change PyDTrace_GC_DONE() argument type from int to Py_ssize_t. (cherry picked from commit edad38e3e05586ba58291f47756eb3fb808f5577) * bpo-30465: Fix C downcast warning on Windows in ast.c (#6593) ast.c: fstring_fix_node_location() downcasts a pointer difference to a C int. Replace int with Py_ssize_t to fix the compiler warning. (cherry picked from commit fb7e7992beec7f76cc2db77ab6ce1e86446bfccf) * bpo-9566: Fix compiler warnings in peephole.c (GH-10652) (cherry picked from commit 028f0ef4f3111d2b3fc5b971642e337ba7990873) * bpo-27645, sqlite: Fix integer overflow on sleep (#6594) Use the _PyTime_t type and round away from zero (ROUND_UP, _PyTime_ROUND_TIMEOUT) the sleep duration, when converting a Python object to seconds and then to milliseconds. Raise an OverflowError in case of overflow. Previously the (int)double conversion rounded towards zero (ROUND_DOWN). (cherry picked from commit ca405017d5e776a2e3d9291236e62d2e09489dd2)
* bpo-36523: Add docstring to io.IOBase.writelines (GH-12683)Marcin Niemira2019-04-222-3/+12
| | | (cherry picked from commit ab86521a9d9999731e39bd9056420bb7774fd144)
* bpo-36650: Fix handling of empty keyword args in C version of lru_cache. ↵Miss Islington (bot)2019-04-201-4/+3
| | | | | | | (GH-12881) (GH-12888) (cherry picked from commit 14adbd45980f705cb6554ca17b8a66b56e105296) Co-authored-by: Raymond Hettinger <rhettinger@users.noreply.github.com>
* [3.7] bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory ↵Victor Stinner2019-04-111-0/+57
| | | | | | | | | | | | | | | | | | | | | | | | (GH-12770) (GH-12788) * bpo-36389: _PyObject_IsFreed() now also detects uninitialized memory (GH-12770) Replace _PyMem_IsFreed() function with _PyMem_IsPtrFreed() inline function. The function is now way more efficient, it became a simple comparison on integers, rather than a short loop. It detects also uninitialized bytes and "forbidden bytes" filled by debug hooks on memory allocators. Add unit tests on _PyObject_IsFreed(). (cherry picked from commit 2b00db68554422ec37faba2a80179a0172df6349) * bpo-36389: Change PyMem_SetupDebugHooks() constants (GH-12782) Modify CLEANBYTE, DEADDYTE and FORBIDDENBYTE constants: use 0xCD, 0xDD and 0xFD, rather than 0xCB, 0xBB and 0xFB, to use the same byte patterns than Windows CRT debug malloc() and free(). (cherry picked from commit 4c409beb4c360a73d054f37807d3daad58d1b567)
* [3.7] bpo-36440: include node names in ParserError messages, instead of ↵Pablo Galindo2019-04-031-6/+11
| | | | | | | | numeric IDs (GH-12565) (GH-12671) The error messages in the parser module are referring to numeric IDs for the nodes. To improve readability, use the node names when reporting errors.. (cherry picked from commit cb0748d3939c31168ab5d3b80e3677494497d5e3) Co-authored-by: tyomitch <tyomitch@gmail.com>
* bpo-36504: Fix signed integer overflow in _ctypes.c's PyCArrayType_new(). ↵Miss Islington (bot)2019-04-031-1/+1
| | | | | | | (GH-12660) (cherry picked from commit 487b73ab39c80157474821ef9083f51e0846bd62) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-20844: open script file with "rb" mode (GH-12616)Inada Naoki2019-04-011-1/+1
| | | (cherry picked from commit 10654c19b5e6efdf3c529ff9bf7bcab89bdca1c1)
* bpo-36150: Fix possible assertion failures due to _ctypes.c's ↵Miss Islington (bot)2019-03-311-4/+5
| | | | | | | PyCData_reduce(). (GH-12106) (GH-12642) (cherry picked from commit 5f2c50810a67982b0c80f6d3258fee3647f67005) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-35941: Fix ssl certificate enumeration for windows (GH-12486)Miss Islington (bot)2019-03-281-20/+89
| | | | | | Add a function to collect certificates from several certificate stores into one certificate collection store that is then enumerated. This ensures we load as many certificates as we can access. (cherry picked from commit d93fbbf88e4abdd24a0a55e3ddf85b8420c62052) Co-authored-by: kctherookie <48805853+kctherookie@users.noreply.github.com>
* bpo-36436: Fix _testcapi.pymem_buffer_overflow() (GH-12560)Miss Islington (bot)2019-03-261-0/+4
| | | | | | Handle memory allocation failure. (cherry picked from commit 414b1cde93764cdabb0798b02af4dd7df954424d) Co-authored-by: Victor Stinner <vstinner@redhat.com>
* bpo-36430: Fix a possible reference leak in itertools.count(). (GH-12551)Miss Islington (bot)2019-03-251-0/+1
| | | | | (cherry picked from commit 0523c39e7720b82b38ad793d3f1a5681adcdf873) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-36421: Fix a possible double decref in _ctypes.c's PyCArrayType_new(). ↵Miss Islington (bot)2019-03-251-0/+1
| | | | | | | | | | (GH-12530) Set type_attr to NULL after the assignment to stgdict->proto (like what is done with stgdict after the Py_SETREF() call) so that it is not decrefed twice on error. (cherry picked from commit 5e333784f007950f22de44c1ffab5b0c03d6691f) Co-authored-by: Zackery Spytz <zspytz@gmail.com>
* bpo-36256: Fix bug in parsermodule when parsing if statements (GH-12488)Miss Islington (bot)2019-03-211-5/+17
| | | | | | | | | bpo-36256: Fix bug in parsermodule when parsing if statements In the parser module, when validating nodes before starting the parsing with to create a ST in "parser_newstobject" there is a problem that appears when two arcs in the same DFA state has transitions with labels with the same type. For example, the DFA for if_stmt has a state with two labels with the same type: "elif" and "else" (type NAME). The algorithm tries one by one the arcs until the label that starts the arc transition has a label with the same type of the current child label we are trying to accept. In this case, the arc for "elif" comes before the arc for "else"and passes this test (because the current child label is "else" and has the same type as "elif"). This lead to expecting a namedexpr_test (305) instead of a colon (11). The solution is to compare also the string representation (in case there is one) of the labels to see if the transition that we have is the correct one. (cherry picked from commit 9a0000d15d27361eaa47b77600c7c00a9787a894) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* Fix compiler warning in call_readline() (GH-10820) (GH-12452)Victor Stinner2019-03-201-3/+3
| | | | | | | | | | | | | | | | Replace strncpy() with memcpy() in call_readline() to fix the following warning, the NUL byte is written manually just after: Modules/readline.c: In function ‘call_readline’: Modules/readline.c:1303:9: warning: ‘strncpy’ output truncated before terminating nul copying as many bytes from a string as its length [-Wstringop-truncation] strncpy(p, q, n); ^~~~~~~~~~~~~~~~ Modules/readline.c:1279:9: note: length computed here n = strlen(p); ^~~~~~~~~ (cherry picked from commit 1600f60414e620c4298c15dac803427d8f0a977c)
* bpo-36236: Handle removed cwd at Python init (GH-12450)Victor Stinner2019-03-201-30/+18
| | | | At Python initialization, the current directory is no longer prepended to sys.path if it has been removed.
* bpo-36356: pymain_free() calls _PyRuntime_Finalize() (GH-12436)Victor Stinner2019-03-191-0/+2
| | | | Ensure that _PyRuntime_Finalize() is always call. This change fix a few memory leaks when running "python3 -V".
* [3.7] bpo-36254: Fix invalid uses of %d in format strings in C. (GH-12264). ↵Serhiy Storchaka2019-03-1410-18/+18
| | | | | | | (GH-12322) (cherry picked from commit d53fe5f407ff4b529628b01a1bcbf21a6aad5c3a) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* 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-251-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-251-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-231-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>