summaryrefslogtreecommitdiffstats
path: root/Modules
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45041: Restore `sqlite3` executescript behaviour for `SELECT` queries ↵Erlend Egeberg Aasland2021-10-071-1/+1
| | | | | | | (GH-28509) * bpo-45041: Restore sqlite3 executescript behaviour for select queries * Add regression test
* Fix typos in the Modules directory (GH-28761)Christian Clauss2021-10-0719-21/+21
|
* bpo-29505: Add fuzzer for ast.literal_eval (GH-28777)Ammar Askar2021-10-062-0/+57
| | | This supercedes https://github.com/python/cpython/pull/3437 and fuzzes the method we recommend for unsafe inputs, `ast.literal_eval`. This should exercise the tokenizer and parser.
* bpo-40116: Add insertion order bit-vector to dict values to allow dicts to ↵Mark Shannon2021-10-061-14/+0
| | | | share keys more freely. (GH-28520)
* bpo-44050: Extension modules can share state when they don't support ↵Hai Shi2021-10-051-0/+22
| | | | | sub-interpreters. (GH-27794) Automerge-Triggered-By: GH:encukou
* bpo-45355: Use sizeof(_Py_CODEUNIT) instead of literal 2 for the size of the ↵Serhiy Storchaka2021-10-031-1/+1
| | | | code unit (GH-28711)
* Remove trailing spaces. (GH-28706)Serhiy Storchaka2021-10-031-1/+1
|
* bpo-45329: Fix freed memory access in pyexpat.c (GH-28649)TAGAMI Yukihiro2021-10-021-1/+1
|
* bpo-44687: Ensure BufferedReader objects with unread buffers can peek even ↵AngstyDuck2021-10-011-3/+5
| | | | when the underlying file is closed (GH-28457)
* bpo-45332: Fix broken Decimal test and benchmark (GH-28680)Dong-hee Na2021-10-013-6/+3
|
* hashlib: Fix old message about unicode objects. (GH-28653)Julien Palard2021-10-011-1/+1
|
* bpo-41710: Add private _PyDeadline_Get() function (GH-28674)Victor Stinner2021-10-017-68/+83
| | | | | | | | Add a private C API for deadlines: add _PyDeadline_Init() and _PyDeadline_Get() functions. * Add _PyTime_Add() and _PyTime_Mul() functions which compute t1+t2 and t1*t2 and clamp the result on overflow. * _PyTime_MulDiv() now uses _PyTime_Add() and _PyTime_Mul().
* bpo-41710: gc_collect_main() uses _PyTime_GetPerfCounter() (GH-28676)Victor Stinner2021-10-011-2/+2
| | | | | | | | | If the DEBUG_STATS debug flag is set, gc_collect_main() now uses _PyTime_GetPerfCounter() instead of _PyTime_GetMonotonicClock() to measure the elapsed time. On Windows, _PyTime_GetMonotonicClock() only has a resolution of 15.6 ms, whereas _PyTime_GetPerfCounter() is closer to a resolution of 100 ns.
* bpo-41710: PyThread_acquire_lock_timed() clamps the timout (GH-28643)Victor Stinner2021-09-303-3/+3
| | | | | | | | | | | | | | | | | | | PyThread_acquire_lock_timed() now clamps the timeout into the [_PyTime_MIN; _PyTime_MAX] range (_PyTime_t type) if it is too large, rather than calling Py_FatalError() which aborts the process. PyThread_acquire_lock_timed() no longer uses MICROSECONDS_TO_TIMESPEC() to compute sem_timedwait() argument, but _PyTime_GetSystemClock() and _PyTime_AsTimespec_truncate(). Fix _thread.TIMEOUT_MAX value on Windows: the maximum timeout is 0x7FFFFFFF milliseconds (around 24.9 days), not 0xFFFFFFFF milliseconds (around 49.7 days). Set PY_TIMEOUT_MAX to 0x7FFFFFFF milliseconds, rather than 0xFFFFFFFF milliseconds. Fix PY_TIMEOUT_MAX overflow test: replace (us >= PY_TIMEOUT_MAX) with (us > PY_TIMEOUT_MAX).
* bpo-41710: Add _PyTime_AsTimespec_clamp() (GH-28629)Victor Stinner2021-09-304-4/+47
| | | | | | | | | | | | | | | Add the _PyTime_AsTimespec_clamp() function: similar to _PyTime_AsTimespec(), but clamp to _PyTime_t min/max and don't raise an exception. PyThread_acquire_lock_timed() now uses _PyTime_AsTimespec_clamp() to remove the Py_UNREACHABLE() code path. * Add _PyTime_AsTime_t() function. * Add PY_TIME_T_MIN and PY_TIME_T_MAX constants. * Replace _PyTime_AsTimeval_noraise() with _PyTime_AsTimeval_clamp(). * Add pytime_divide_round_up() function. * Fix integer overflow in pytime_divide(). * Add pytime_divmod() function.
* bpo-43753: _operator.is_() uses Py_Is() (GH-28641)Victor Stinner2021-09-291-4/+2
|
* bpo-45211: Remember the stdlib dir during startup. (gh-28586)Eric Snow2021-09-281-0/+10
| | | | | During runtime startup we figure out the stdlib dir but currently throw that information away. This change preserves it and exposes it via PyConfig.stdlib_dir, _Py_GetStdlibDir(), and sys._stdlib_dir. https://bugs.python.org/issue45211
* bpo-35606: Fix math.prod tests using 'start' as keyword parameter (GH-28595)Pablo Galindo Salgado2021-09-281-8/+3
|
* bpo-45211: Move helpers from getpath.c to internal API. (gh-28550)Eric Snow2021-09-271-56/+8
| | | | | | | | | | | | This accomplishes 2 things: * consolidates some common code between getpath.c and getpathp.c * makes the helpers available to code in other files FWIW, the signature of the join_relfile() function (in fileutils.c) intentionally mirrors that of Windows' PathCchCombineEx(). Note that this change is mostly moving code around. No behavior is meant to change. https://bugs.python.org/issue45211
* bpo-44958: Revert GH-27844 (GH-28574)Erlend Egeberg Aasland2021-09-263-40/+39
| | | | This reverts commit 050d1035957379d70e8601e6f5636637716a264b, but keeps the tests.
* bpo-21302: Add nanosleep() implementation for time.sleep() in Unix (GH-28545)Victor Stinner2021-09-251-23/+33
| | | Co-authored-by: Livius <egyszeregy@freemail.hu>
* bpo-44019: Implement operator.call(). (GH-27888)Antony Lee2021-09-241-0/+22
| | | | | | Having `operator.call(obj, arg)` mean `type(obj).__call__(obj, arg)` is consistent with the other dunder operators. The semantics with `*args, **kwargs` then follow naturally from the single-arg semantics.
* bpo-21302: time.sleep() uses waitable timer on Windows (GH-28483)Victor Stinner2021-09-221-43/+110
| | | | | | | | | | | | On Windows, time.sleep() now uses a waitable timer which has a resolution of 100 ns (10^-7 sec). Previously, it had a solution of 1 ms (10^-3 sec). * On Windows, time.sleep() now calls PyErr_CheckSignals() before resetting the SIGINT event. * Add _PyTime_As100Nanoseconds() function. * Complete and update time.sleep() documentation. Co-authored-by: Livius <egyszeregy@freemail.hu>
* [codemod] Fix non-matching bracket pairs (GH-28473)Mohamad Mansour2021-09-215-7/+7
| | | | | Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* bpo-44958: Only reset `sqlite3` statements when needed (GH-27844)Erlend Egeberg Aasland2021-09-213-39/+40
|
* bpo-45041: Simplify `sqlite3.Cursor.executescript()` (GH-28020)Erlend Egeberg Aasland2021-09-191-42/+25
|
* bpo-45040: Simplify sqlite3 transaction control functions (GH-28019)Erlend Egeberg Aasland2021-09-192-63/+28
|
* Clean up initialization __class_getitem__ with Py_GenericAlias. (GH-28450)Serhiy Storchaka2021-09-197-9/+9
| | | | | The cast to PyCFunction is redundant. Overuse of redundant casts can hide actual bugs.
* bpo-45228: Fix stack buffer overflow in parsing J1939 address (GH-28404)Serhiy Storchaka2021-09-171-8/+8
|
* bpo-21302: Add _PyTime_AsNanoseconds() (GH-28350)Victor Stinner2021-09-152-43/+37
| | | | | | | | | | | | | | | | | Refactor pytime.c: * Add pytime_from_nanoseconds() and pytime_as_nanoseconds(), and use explicitly these functions * Add two empty lines between functions * PEP 7: add braces { ... } * C99: declare variables where they are set * Rename private functions to lowercase * Rename error_time_t_overflow() to pytime_time_t_overflow() * Rename win_perf_counter_frequency() to py_win_perf_counter_frequency() * py_get_monotonic_clock(): add an assertion to detect overflow when mach_absolute_time() unsigned uint64_t is casted to _PyTime_t (signed int64_t). _testcapi: use _PyTime_FromNanoseconds().
* closes bpo-45190: Update Unicode data to version 14.0.0. (GH-28336)Benjamin Peterson2021-09-143-30621/+31662
|
* bpo-21302: Add clock_nanosleep() implementation for time.sleep() (GH-28111)Livius2021-09-131-5/+31
| | | | | | In Unix operating systems, time.sleep() now uses the clock_nanosleep() function, if available, which allows to sleep for an interval specified with nanosecond precision. Co-authored-by: Victor Stinner <vstinner@python.org>
* bpo-45126: Fix ref. leak in `sqlite3.Connection.__init__` (GH-28231)Erlend Egeberg Aasland2021-09-122-13/+49
|
* bpo-43413: Fix handling keyword arguments in subclasses of some buitin ↵Serhiy Storchaka2021-09-1211-33/+58
| | | | | | | | classes (GH-26456) * Constructors of subclasses of some buitin classes (e.g. tuple, list, frozenset) no longer accept arbitrary keyword arguments. * Subclass of set can now define a __new__() method with additional keyword parameters without overriding also __init__().
* bpo-44987: Speed up unicode normalization of ASCII strings (GH-28283)Dong-hee Na2021-09-111-0/+4
|
* bpo-45163: Haiku build fix. (GH-28269)David CARLIER2021-09-111-1/+1
| | | | | | linkage issues mainly for shared libs and missing system library, also little nit into the signal extension as strsignal returns a constant in this platform.
* bpo-40563: Support pathlike objects on dbm/shelve (GH-21849)Henry-Joseph Audéoud2021-09-104-24/+12
| | | | Co-authored-by: Hakan Çelik <hakancelik96@outlook.com>
* bpo-45067 - Verify the version of ncurses for extended color support feature ↵Senthil Kumaran2021-09-091-2/+2
| | | | | | | | | | | | | | usage. (GH-28260) * issue45067 - Fix _curses compilation in CentOS 7. Verify the version of ncurses for extended color support feature usage. The function extended_color_content was introduced in 2017. The ncurses-devel package in CentOS 7 had a older version ncurses resulted in compilation error. For compiling ncurses with extended color support, we verify the version of the ncurses library. Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44219: Release the GIL during isatty syscalls (GH-28250)Vincent Michel2021-09-091-0/+2
| | | | | | Release the GIL while performing isatty() system calls on arbitrary file descriptors. In particular, this affects os.isatty(), os.device_encoding() and io.TextIOWrapper. By extension, io.open() in text mode is also affected.
* bpo-38371: Remove deprecated `tkinter` split() method (GH-28237)Erlend Egeberg Aasland2021-09-082-211/+1
|
* bpo-39573: Py_TYPE becomes a static inline function (GH-28128)Victor Stinner2021-09-081-4/+3
| | | | | Convert the Py_TYPE() and Py_SIZE() macros to static inline functions. The Py_SET_TYPE() and Py_SET_SIZE() functions must now be used to set an object type and size.
* Remove documentation for non-existing socket class attributes (GH-28029)Matti Picus2021-09-071-3/+0
| | | The functions in question are available on the module-level only.
* bpo-45012: Release GIL around stat in os.scandir (GH-28085)Stanisław Skonieczny2021-09-071-2/+8
| | | | | Releasing GIL allows other threads to continue its work when os.scandir is fetching DirEntry.stat info from file system.
* bpo-42064: Pass module state to trace, progress, and authorizer callbacks ↵Erlend Egeberg Aasland2021-09-072-73/+111
| | | | | | | | (GH-27940) - add print-or-clear traceback helper - add helpers to clear and visit saved contexts - modify callbacks to use the new callback_context struct
* bpo-45034: Fix how upper limit is formatted for `struct.pack("H", ...)` ↵Nikita Sobolev2021-09-071-6/+6
| | | | | | (GH-28178) Co-authored-by: Mark Dickinson <dickinsm@gmail.com> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* bpo-44991: Normalise `sqlite3` callback naming (GH-28088)Erlend Egeberg Aasland2021-09-072-52/+59
| | | | | | | | - all callbacks are now named xxx_callback - normalise callable naming in set_*() functions - normalise context argument naming in callbacks The sqlite code is being "touched" in bpo-42064 (and related issues); this style change makes it easier to work with and review.
* Remove unused macros from Modules/_sqlite/microprotocols.h (GH-28171)Erlend Egeberg Aasland2021-09-051-6/+0
|
* bpo-45094: Add Py_NO_INLINE macro (GH-28140)Victor Stinner2021-09-033-4/+4
| | | | | * Rename _Py_NO_INLINE macro to Py_NO_INLINE: make it public and document it. * Sort macros in the C API documentation.
* bpo-45082: Cleanup ctypes.c_buffer alias (GH-28129)Victor Stinner2021-09-021-2/+2
| | | | | * Remove commented deprecation of ctypes.c_buffer. * Remove references to ctypes.c_string which doesn't exist. * Remove StringTestCase: it only had skipped test methods.
* bpo-43613: Faster implementation of gzip.compress and gzip.decompress (GH-27941)Ruben Vorderman2021-09-022-13/+28
| | | Co-authored-by: Łukasz Langa <lukasz@langa.pl>