summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* Put pyexpatns.h include back. bpo-37437 (GH-14539)Benjamin Peterson2019-07-021-0/+4
|
* bpo-37363: Add audit events on startup for the run commands (GH-14524)Steve Dower2019-07-011-0/+21
|
* bpo-36763: Use PyConfig_Clear() (GH-14445)Victor Stinner2019-07-011-4/+8
| | | | | Stop using "static PyConfig", PyConfig must now always use dynamically allocated strings: use PyConfig_SetString(), PyConfig_SetArgv() and PyConfig_Clear().
* bpo-37428: Don't set PHA verify flag on client side (GH-14421)Christian Heimes2019-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
* bpo-29505: Add more fuzzing for re.compile, re.load and csv.reader (GH-14255)Ammar Askar2019-06-308-16/+491
| | | Add more fuzz testing for re.compile, re.load and csv.reader
* bpo-37412: Fix os.getcwd() for long path on Windows (GH-14424)Victor Stinner2019-06-281-1/+1
| | | | * Fix test for integer overflow. * Add an unit test.
* bpo-20443: Fix calculate_program_full_path() warning (GH-14446)Victor Stinner2019-06-281-1/+1
| | | | Don't call _Py_isabs() with a bytes string (char*), the function expects as wide string.
* bpo-37337: Add _PyObject_VectorcallMethod() (GH-14228)Jeroen Demeyer2019-06-281-6/+13
|
* closes bpo-37437: Update vendorized expat to 2.2.7. (GH-14436)Benjamin Peterson2019-06-286-32/+21
|
* closes bpo-37420: Handle errors during iteration in os.sched_setaffinity. ↵Brandt Bucher2019-06-271-0/+3
| | | | (GH-14414)
* bpo-37419: Fix possible segfaults when passing large sequences to ↵Zackery Spytz2019-06-261-1/+1
| | | | | os.posix_spawn() (GH-14409) Use Py_ssize_t instead of int for i.
* bpo-37412: os.getcwdb() now uses UTF-8 on Windows (GH-14396)Victor Stinner2019-06-261-59/+64
| | | | | | | | | The os.getcwdb() function now uses the UTF-8 encoding on Windows, rather than the ANSI code page: see PEP 529 for the rationale. The function is no longer deprecated on Windows. os.getcwd() and os.getcwdb() now detect integer overflow on memory allocations. On Unix, these functions properly report MemoryError on memory allocation failure.
* bpo-37406: sqlite3 raises TypeError for wrong operation type (GH-14386)Victor Stinner2019-06-263-13/+5
| | | | | The sqlite3 module now raises TypeError, rather than ValueError, if operation argument type is not str: execute(), executemany() and calling a connection.
* bpo-37388: Development mode check encoding and errors (GH-14341)Victor Stinner2019-06-251-0/+43
| | | | | | | | | In development mode and in debug build, encoding and errors arguments are now checked on string encoding and decoding operations. Examples: open(), str.encode() and bytes.decode(). By default, for best performances, the errors argument is only checked at the first encoding/decoding error, and the encoding argument is sometimes ignored for empty strings.
* bpo-20443: _PyConfig_Read() gets the absolute path of run_filename (GH-14053)Victor Stinner2019-06-252-29/+25
| | | | | | | | | | | | Python now gets the absolute path of the script filename specified on the command line (ex: "python3 script.py"): the __file__ attribute of the __main__ module, sys.argv[0] and sys.path[0] become an absolute path, rather than a relative path. * Add _Py_isabs() and _Py_abspath() functions. * _PyConfig_Read() now tries to get the absolute path of run_filename, but keeps the relative path if _Py_abspath() fails. * Reimplement os._getfullpathname() using _Py_abspath(). * Use _Py_isabs() in getpath.c.
* bpo-32627: Fix compile error when conflicting `_uuid` headers included ↵ziheng2019-06-241-3/+6
| | | | (GH-11751)
* bpo-37363: Add audit events for a range of modules (GH-14301)Steve Dower2019-06-242-0/+13
|
* bpo-37345: Add formal UDPLITE support (GH-14258)Gabe Appleton2019-06-241-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | At the moment you can definitely use UDPLITE sockets on Linux systems, but it would be good if this support were formalized such that you can detect support at runtime easily. At the moment, to make and use a UDPLITE socket requires something like the following code: ``` >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, 136) >>> a.bind(('localhost', 44444)) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 16) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 32) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.setsockopt(136, 10, 64) >>> b.sendto(b'test'*256, ('localhost', 44444)) ``` If you look at this through Wireshark, you can see that the packets are different in that the checksums and checksum coverages change. With the pull request that I am submitting momentarily, you could do the following code instead: ``` >>> import socket >>> a = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> b = socket.socket(socket.AF_INET, socket.SOCK_DGRAM, socket.IPPROTO_UDPLITE) >>> a.bind(('localhost', 44444)) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(16) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(32) >>> b.sendto(b'test'*256, ('localhost', 44444)) >>> b.set_send_checksum_coverage(64) >>> b.sendto(b'test'*256, ('localhost', 44444)) ``` One can also detect support for UDPLITE just by checking ``` >>> hasattr(socket, 'IPPROTO_UDPLITE') ``` https://bugs.python.org/issue37345
* bpo-37316: mmap.mmap() passes the wrong variable to PySys_Audit() (GH-14152)Zackery Spytz2019-06-211-1/+1
| | | Also, add a missing call to va_end() in PySys_Audit().
* Fix name of '\0'. (GH-14222)Benjamin Peterson2019-06-191-1/+1
| | | '\0' is the NUL byte not NULL.
* bpo-35134: Add Include/cpython/import.h header file (GH-14213)Victor Stinner2019-06-181-0/+1
| | | | | | * Add Include/cpython/import.h and Include/internal/pycore_import.h header files. * Move _PyImport_ReInitLock() to the internal C API. Don't export the symbol anymore.
* bpo-37315: Deprecate accepting floats in math.factorial(). (GH-14147)Serhiy Storchaka2019-06-171-0/+6
|
* bpo-37194: Add a new public PyObject_CallNoArgs() function (GH-13890)Victor Stinner2019-06-176-16/+16
| | | | | | | | | | | | | | | Add a new public PyObject_CallNoArgs() function to the C API: call a callable Python object without any arguments. It is the most efficient way to call a callback without any argument. On x86-64, for example, PyObject_CallFunctionObjArgs(func, NULL) allocates 960 bytes on the stack per call, whereas PyObject_CallNoArgs(func) only allocates 624 bytes per call. It is excluded from stable ABI 3.8. Replace private _PyObject_CallNoArg() with public PyObject_CallNoArgs() in C extensions: _asyncio, _datetime, _elementtree, _pickle, _tkinter and readline.
* Turn math.isqrt assertion into a comment to clarify its purpose. (GH-14131)Mark Dickinson2019-06-161-1/+1
|
* Simplify negativity checks in math.comb and math.perm. (GH-13870)Mark Dickinson2019-06-161-10/+16
|
* bpo-37266: Daemon threads are now denied in subinterpreters (GH-14049)Victor Stinner2019-06-142-0/+46
| | | | | | | | | | | | In a subinterpreter, spawning a daemon thread now raises an exception. Daemon threads were never supported in subinterpreters. Previously, the subinterpreter finalization crashed with a Pyton fatal error if a daemon thread was still running. * Add _thread._is_main_interpreter() * threading.Thread.start() now raises RuntimeError if the thread is a daemon thread and the method is called from a subinterpreter. * The _thread module now uses Argument Clinic for the new function. * Use textwrap.dedent() in test_threading.SubinterpThreadingTests
* bpo-35070: test_getgrouplist may fail on macOS if too many groups (GH-13071)Jeffrey Kintscher2019-06-131-15/+17
|
* bpo-37253: Add _PyCompilerFlags_INIT macro (GH-14018)Victor Stinner2019-06-133-5/+3
| | | | | Add a new _PyCompilerFlags_INIT macro to initialize PyCompilerFlags variables, rather than initializing cf_flags and cf_feature_version explicitly in each variable.
* bpo-36779: time.tzname returns empty string on Windows if default cod… ↵Paul Monson2019-06-121-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
* bpo-29505: Fuzz json module, enforce size limit on int(x) fuzz (GH-13991)Ammar Askar2019-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.
* closes bpo-35184: Fix XML_POOR_ENTROPY option that breaks makesetup parsing ↵aaronpaulhurst2019-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.
* bpo-37178: Allow a one argument form of math.perm() (GH-13905)Raymond Hettinger2019-06-082-6/+19
|
* bpo-29505: Fix interpreter in fuzzing targets to be relocatable (GH-13907)Ammar Askar2019-06-081-0/+8
|
* bpo-37169: Rewrite _PyObject_IsFreed() unit tests (GH-13888)Victor Stinner2019-06-071-13/+14
| | | | | Replace two Python function calls with a single one to ensure that no memory allocation is done between the invalid object is created and when _PyObject_IsFreed() is called.
* bpo-37188: Fix a divide-by-zero in arrays of size-0 objects (#13881)Eric Wieser2019-06-071-1/+1
|
* bpo-37170: Fix the cast on error in PyLong_AsUnsignedLongLongMask() (GH-13860)Zackery Spytz2019-06-061-0/+22
|
* bpo-37165: Convert _count_elements to the argument clinic (GH-13848)Raymond Hettinger2019-06-052-12/+48
|
* bpo-35431: Drop the k <= n requirement (GH-13798)Raymond Hettinger2019-06-042-24/+31
|
* Revert "bpo-36818: Add PyInterpreterState.runtime field. (gh-13129)" (GH-13795)Victor Stinner2019-06-041-1/+1
| | | This reverts commit 396e0a8d9dc65453cb9d53500d0a620602656cfe.
* bpo-37120: Add SSLContext.num_tickets (GH-13719)Christian Heimes2019-06-031-0/+37
| | | Signed-off-by: Christian Heimes <christian@python.org>
* bpo-34271: Fix compatibility with 1.0.2 (GH-13728)Christian Heimes2019-06-031-1/+10
| | | | | | Fix various compatibility issues with LibreSSL and OpenSSL 1.0.2 introduced by bpo-34271. Signed-off-by: Christian Heimes <christian@python.org>
* Revert "bpo-33608: Factor out a private, per-interpreter ↵Victor Stinner2019-06-032-11/+2
| | | | | _Py_AddPendingCall(). (gh-13714)" (GH-13780) This reverts commit 6a150bcaeb190d1731b38ab9c7a5d1a352847ddc.
* bpo-36027 bpo-36974: Fix "incompatible pointer type" compiler warnings ↵Petr Viktorin2019-06-021-1/+1
| | | | (GH-13758)
* bpo-36974: Make tp_call=PyVectorcall_Call work for inherited types (GH-13699)Petr Viktorin2019-06-021-1/+1
| | | | | | | | | | | | | | | | | | When inheriting a heap subclass from a vectorcall class that sets `.tp_call=PyVectorcall_Call` (as recommended in PEP 590), the subclass does not inherit `_Py_TPFLAGS_HAVE_VECTORCALL`, and thus `PyVectorcall_Call` does not work for it. This attempts to solve the issue by: * always inheriting `tp_vectorcall_offset` unless `tp_call` is overridden in the subclass * inheriting _Py_TPFLAGS_HAVE_VECTORCALL for static types, unless `tp_call` is overridden * making `PyVectorcall_Call` ignore `_Py_TPFLAGS_HAVE_VECTORCALL` This means it'll be ever more important to only call `PyVectorcall_Call` on classes that support vectorcall. In `PyVectorcall_Call`'s intended role as `tp_call` filler, that's not a problem.
* bpo-37128: Add math.perm(). (GH-13731)Serhiy Storchaka2019-06-022-2/+165
|
* bpo-33608: Factor out a private, per-interpreter _Py_AddPendingCall(). ↵Eric Snow2019-06-012-2/+11
| | | | (gh-13714)
* Fix the error handling in bytesio_sizeof(). (GH-10459)Zackery Spytz2019-06-011-2/+7
| | | bytesio_sizeof() must check if an error has occurred in _PySys_GetSizeOf().
* bpo-34303: Micro-optimizations in functools.reduce() (GH-8598)Sergey Fedoseev2019-06-011-3/+6
|
* bpo-35431: Refactor math.comb() implementation. (GH-13725)Serhiy Storchaka2019-06-012-92/+87
| | | | | | | * Fixed some bugs. * Added support for index-likes objects. * Improved error messages. * Cleaned up and optimized the code. * Added more tests.
* bpo-35431: Implemented math.comb (GH-11414)Yash Aggarwal2019-06-012-1/+171
|