Commit Graph

12087 Commits

Author SHA1 Message Date
Antoine Pitrou 68245b7a10
bpo-43406: Fix possible race condition where ``PyErr_CheckSignals`` tries to execute a non-Python signal handler (GH-24756)
We can receive signals (at the C level, in `trip_signal()` in signalmodule.c) while `signal.signal` is being called to modify the corresponding handler.  Later when `PyErr_CheckSignals()` is called to handle the given signal, the handler may be a non-callable object and would raise a cryptic asynchronous exception.
2021-03-05 10:32:50 +01:00
Erlend Egeberg Aasland e161ec5dd7
bpo-43369: sqlite3_column_{text,blob} failures now raise MemoryError (GH-24723) 2021-03-04 11:50:25 +02:00
Brandt Bucher c61ec7e6b8
bpo-43394: Fix -Wstrict-prototypes warnings (GH-24737) 2021-03-03 21:53:59 -08:00
Mariusz Felisiak 3b4b2cf418
bpo-43368: Fix fetching empty bytes in sqlite3 (GH-24706)
Regression introduced in 47feb1feb2.
2021-03-03 16:16:24 +02:00
Alperen Serkan Aksöz 09605ad726
missing multiply symbol in the documentation (GH-24686) 2021-03-03 14:59:52 +01:00
Alex Henrie 25e244c925
bpo-39523: Use do-while loop pysqlite_cursor_executescript() (GH-18305) 2021-03-02 09:40:34 +02:00
Filipe Laíns 0d7ad9fb38
bpo-29753: fix merging packed bitfields in ctypes struct/union (GH-19850)
From the commit message:

> When the structure is packed we should always expand when needed,
> otherwise we will add some padding between the fields. This patch makes
> sure we always merge bitfields together. It also changes the field merging
> algorithm so that it handles bitfields correctly.

Automerge-Triggered-By: GH:jaraco
2021-02-28 14:43:19 -08:00
Erlend Egeberg Aasland 2183d06bc8
bpo-43251: sqlite3_column_name() failures now raise MemoryError (GH-24609) 2021-02-28 19:01:06 +02:00
Dong-hee Na bf9de7ab24
bpo-43335: Update macro to check gcc version (GH-24662) 2021-02-28 09:16:24 +09:00
Erlend Egeberg Aasland 5e48e83688
bpo-43294: Remove unused variables in pysqlite_connection_*() (GH-24658) 2021-02-26 16:30:22 +02:00
Erlend Egeberg Aasland 3150754f91
bpo-43314: Remove SQLITE_OPEN_URI ifdef (GH-24637)
SQLite 3.7.15 is required as by GH-24106. SQLITE_OPEN_URI was added in
SQLite 3.7.7.
2021-02-26 02:48:19 +02:00
Erlend Egeberg Aasland 91ea37c84a
bpo-43290: Remove workaround from pysqlite_step() (GH-24638)
From the SQLite 3.5.3 changelog:

sqlite3_step() returns SQLITE_MISUSE instead of crashing when called
with a NULL parameter.

The workaround no longer needed because we no longer support
SQLite releases older than 3.7.15.
2021-02-26 01:39:34 +02:00
Inada Naoki 01806d5beb
bpo-43260: io: Prevent large data remains in textio buffer. (GH-24592)
When very large data remains in TextIOWrapper, flush() may fail forever.

So prevent that data larger than chunk_size is remained in TextIOWrapper internal
buffer.

Co-Authored-By: Eryk Sun
2021-02-22 08:29:30 +09:00
Erlend Egeberg Aasland 38b6c2acd4
bpo-43269: Remove redundant extern keywords (GH-24605) 2021-02-21 12:07:49 +02:00
Erlend Egeberg Aasland bf838a6e7e
bpo-43269: Clean up sqlite3 file scope (GH-24578) 2021-02-21 02:29:19 +02:00
Victor Stinner 839184f85c
bpo-43268: local_clear() uses _PyInterpreterState_GET() (GH-24583)
Cleanup also the code.
2021-02-19 15:51:36 +01:00
Victor Stinner bcb094b41f
bpo-43268: Pass interp rather than tstate to internal functions (GH-24580)
Pass the current interpreter (interp) rather than the current Python
thread state (tstate) to internal functions which only use the
interpreter.

Modified functions:

* _PyXXX_Fini() and _PyXXX_ClearFreeList() functions
* _PyEval_SignalAsyncExc(), make_pending_calls()
* _PySys_GetObject(), sys_set_object(), sys_set_object_id(), sys_set_object_str()
* should_audit(), set_flags_from_config(), make_flags()
* _PyAtExit_Call()
* init_stdio_encoding()
* etc.
2021-02-19 15:10:45 +01:00
Victor Stinner 5592f2b9da
bpo-43268: Replace _PyThreadState_GET() with _PyInterpreterState_GET() (GH-24576)
Replace _PyThreadState_GET() with _PyInterpreterState_GET() in
functions which only need the current interpreter, but don't need the
current Python thread state.

Replace also _PyThreadState_UncheckedGet() with _PyThreadState_GET()
in faulthandler.c, since _PyThreadState_UncheckedGet() is just an
alias to _PyThreadState_GET() in practice.
2021-02-19 13:21:28 +01:00
Erlend Egeberg Aasland 2bb0bf4dd8
bpo-43258: Make sqlite3 callback functions static (GH-24574) 2021-02-19 13:59:24 +02:00
Erlend Egeberg Aasland 979b23cbe4
bpo-43258: Don't allocate sqlite3 aggregate context for empty queries (GH-24569) 2021-02-19 13:20:32 +02:00
Erlend Egeberg Aasland cc96231f0a
bpo-43249: Improve scoping in _pysqlite_fetch_one_row() (GH-24565) 2021-02-18 19:13:14 +02:00
Erlend Egeberg Aasland 47feb1feb2
bpo-43249: sqlite3_column_bytes() must follow sqlite_column_blob() (GH-24562) 2021-02-18 17:44:43 +02:00
David CARLIER 7be00ee64a
bpo-42960: Add resource.RLIMIT_KQUEUES constant from FreeBSD (GH-24251) 2021-02-18 16:26:20 +01:00
Nicholas Sim 17dbd4078b
bpo-35134, Include: Move pytime.h to cpython/pytime.h (GH-23988)
This change is backward compatible since C extension modules
must not include "pytime.h" directly, but only include "Python.h".
2021-02-16 13:04:38 +01:00
Dustin Rodrigues 755f3c1521
bpo-42819, readline: Disable bracketed paste (GH-24108) 2021-02-16 00:28:24 +01:00
Erlend Egeberg Aasland 1b57426e3a
bpo-43210: Fix byteswap comment in sha512.module.c (GH-24518) 2021-02-14 23:14:26 +09:00
Gregory P. Smith fd053fdd39
bpo-43172: readline now passes its tests when built against libedit (GH-24499)
bpo-43172: readline now passes its tests when built against libedit.

Existing irreconcilable API differences remain in readline.get_begidx
and readline.get_endidx behavior based on libreadline vs libedit use.
A note about that has been documented.
2021-02-12 12:04:46 -08:00
Erlend Egeberg Aasland 5ec7d53558
bpo-43204: Fix LibTomCrypt URL in md5module.c and sha*module.c comments (GH-24507)
Automerge-Triggered-By: GH:tiran
2021-02-12 02:34:11 -08:00
Erlend Egeberg Aasland ea46579067
bpo-40956: Fix segfault when Connection.backup is called without target (GH-24503) 2021-02-11 01:04:02 +02:00
Roland Hieber e1f7769513
bpo-13501: allow choosing between readline and libedit (GH-24189)
In contrast to macOS, libedit is available as its own include file and
library on Linux systems to prevent file name clashes. So if both
libraries are available on the system, readline is currently chosen by
default; and if only libedit is available, it is not found at all. This
patch adds a way to link against libedit by adding the following
arguments to configure:

  --with-readline           link against libreadline (the default)
  --with-readline=editline  link against libeditline
  --with-readline=no        disable building the readline module
  --without-readline        (same)

The runtime detection of libedit vs. readline was already done in commit
7105319ada (2019-12-04, serge-sans-paille: "bpo-38634: Allow
non-apple build to cope with libedit (GH-16986)").

Fixes: GH-12076 ("bpo-13501 Build or disable readline with Editline")
Fixes: bpo-13501 ("Make libedit support more generic; port readline / libedit to FreeBSD")
Co-authored-by: Enji Cooper (ngie-eign)
Co-authored-by: Martin Panter (vadmium)
Co-authored-by: Robert Marshall (kellinm)
2021-02-08 17:05:25 -08:00
Zackery Spytz effaec0bb5
bpo-43132: Fix incorrect handling of PyObject_RichCompareBool() in _zoneinfo (GH-24450)
PyObject_RichCompareBool() returns -1 on error, but this case is
not handled by the find_in_strong_cache() function.  Any exception
raised by PyObject_RichCompareBool() should be propagated.
2021-02-05 10:25:30 +02:00
Dong-hee Na f917c243c5
bpo-43106: Add os.O_EVTONLY/O_FSYNC/O_SYMLINK/O_NOFOLLOW_ANY (GH-24428) 2021-02-04 08:32:55 +09:00
Pablo Galindo bb739ec922
bpo-43108: Fix a reference leak in the curses module (GH-24420) 2021-02-02 20:38:26 +00:00
Ken Jin b5931f1d9f
bpo-42834: Fix _json internal caches for subinterpreters (GH-24121)
Make internal caches of the _json extension module
compatible with subinterpreters.
2021-02-01 17:26:56 +01:00
Anonymous Maarten 3243e8a4b4
bpo-41604: Don't decrement the reference count of the previous user_ptr when set_panel_usertpr fails (GH-21933) 2021-01-31 19:55:15 +02:00
Serhiy Storchaka 9073180db5
bpo-43083: Fix error handling in _sqlite3 (GH-24395) 2021-01-31 17:42:38 +02:00
Victor Stinner 0837f99d33
bpo-42323: Fix math.nextafter() on AIX (GH-24381)
math_nextafter_impl() must return a Python object, not a C double.
2021-01-29 23:04:50 +01:00
Victor Stinner c9b8e9c421
bpo-42979: Enhance abstract.c assertions checking slot result (GH-24352)
* bpo-42979: Enhance abstract.c assertions checking slot result

Add _Py_CheckSlotResult() function which fails with a fatal error if
a slot function succeeded with an exception set or failed with no
exception set: write the slot name, the type name and the current
exception (if an exception is set).
2021-01-27 16:39:16 +00:00
Hai Shi eeb701adc0
bpo-42979: _zoneinfo exec function checks for PyDateTime_IMPORT failure (GH-24333)
Importing datetime can fail.
2021-01-27 11:23:33 +01:00
Zackery Spytz 5327f37034
bpo-43033: Fix the handling of PyObject_SetAttrString() in _zoneinfo.c (GH-24345) 2021-01-27 10:16:20 +02:00
borispopoff c7c3b7db29
Typo in comment (GH-24199)
Automerge-Triggered-By: GH:Mariatta
2021-01-25 14:51:48 -08:00
Hai Shi 2f12a1b7ec
bpo-41798: Allocate the _curses._C_API on the heap memory (GH-24186) 2021-01-22 11:06:43 +01:00
Victor Stinner c1c3493fb7
bpo-42323: Fix math.nextafter() for NaN on AIX (GH-24265) 2021-01-20 15:20:13 +01:00
Erlend Egeberg Aasland 61d26394f9
bpo-41798: Allocate unicodedata CAPI on the heap (GH-24128) 2021-01-20 12:03:53 +01:00
Yunlongs f1ff800db1
bpo-41995: Handle allocation failure in _tracemalloc and _zoneinfo (GH-22635) 2021-01-20 09:38:28 +01:00
Benjamin Peterson 916610ef90
closes bpo-42938: Replace snprintf with Python unicode formatting in ctypes param reprs. (24239) 2021-01-18 14:47:05 -06:00
Victor Stinner 250035d134
bpo-42923: Dump extension modules on fatal error (GH-24207)
The Py_FatalError() function and the faulthandler module now dump the
list of extension modules on a fatal error.

Add _Py_DumpExtensionModules() and _PyModule_IsExtension() internal
functions.
2021-01-18 20:47:13 +01:00
Victor Stinner e232025025
bpo-42923: Add Py_FatalError() test in test_capi (GH-24240)
Move faulthandler._fatal_error() to _testcapi.fatal_error().
2021-01-18 18:24:29 +01:00
Zackery Spytz 14cfa325c2
bpo-39273: Expose BUTTON5_* constants in the curses module if available (GH-17996) 2021-01-14 11:40:09 +02:00
Erlend Egeberg Aasland a330365ca5
bpo-40956: Fix sqlite3.Cursor.fetchmany() default value (GH-24214) 2021-01-14 01:17:33 +02:00