Commit graph

227 commits

Author SHA1 Message Date
Victor Stinner 4a21e57fe5
bpo-40268: Remove unused structmember.h includes (GH-19530)
If only offsetof() is needed: include stddef.h instead.

When structmember.h is used, add a comment explaining that
PyMemberDef is used.
2020-04-15 02:35:41 +02:00
Victor Stinner 62183b8d6d
bpo-40268: Remove explicit pythread.h includes (#19529)
Remove explicit pythread.h includes: it is always included
by Python.h.
2020-04-15 02:04:42 +02:00
Serhiy Storchaka 8f87eefe7f
bpo-39943: Add the const qualifier to pointers on non-mutable PyBytes data. (GH-19472) 2020-04-12 14:58:27 +03:00
Serhiy Storchaka cd8295ff75
bpo-39943: Add the const qualifier to pointers on non-mutable PyUnicode data. (GH-19345) 2020-04-11 10:48:40 +03:00
Serhiy Storchaka b146568dfc
bpo-39652: Truncate the column name after '[' only if PARSE_COLNAMES is set. (GH-18942) 2020-03-21 15:53:28 +02:00
Petr Viktorin ffd9753a94
bpo-39245: Switch to public API for Vectorcall (GH-18460)
The bulk of this patch was generated automatically with:

    for name in \
        PyObject_Vectorcall \
        Py_TPFLAGS_HAVE_VECTORCALL \
        PyObject_VectorcallMethod \
        PyVectorcall_Function \
        PyObject_CallOneArg \
        PyObject_CallMethodNoArgs \
        PyObject_CallMethodOneArg \
    ;
    do
        echo $name
        git grep -lwz _$name | xargs -0 sed -i "s/\b_$name\b/$name/g"
    done

    old=_PyObject_FastCallDict
    new=PyObject_VectorcallDict
    git grep -lwz $old | xargs -0 sed -i "s/\b$old\b/$new/g"

and then cleaned up:

- Revert changes to in docs & news
- Revert changes to backcompat defines in headers
- Nudge misaligned comments
2020-02-11 17:46:57 +01:00
Victor Stinner d2ec81a8c9
bpo-39573: Add Py_SET_TYPE() function (GH-18394)
Add Py_SET_TYPE() function to set the type of an object.
2020-02-07 09:17:07 +01:00
Victor Stinner daa9756cb6
bpo-39573: Use Py_TYPE() macro in Modules directory (GH-18393)
Replace direct access to PyObject.ob_type with Py_TYPE().
2020-02-07 03:37:06 +01:00
Alex Henrie 78c7183f47
bpo-39496: Remove redundant checks from _sqlite/cursor.c (GH-18270) 2020-02-01 23:45:34 +03:00
Alex Henrie 1f44e775df
bpo-39497: Remove unused variable from pysqlite_cursor_executescript (GH-18271) 2020-01-30 12:39:25 +03:00
Alex Henrie 188bb5b1e8
bpo-39494: Remove extra null terminators from kwlist vars (GH-18267) 2020-01-30 07:12:53 +03:00
Sergey Fedoseev b6f5b9dd21 Replace _pysqlite_long_from_int64() with PyLong_FromLongLong() (GH-16882) 2019-10-23 11:09:01 +03:00
Serhiy Storchaka f669581a95
bpo-38185: Fixed case-insensitive string comparison in sqlite3.Row indexing. (GH-16190) 2019-09-17 09:20:56 +03:00
Serhiy Storchaka 8debfa5040
bpo-38175: Fix a memory leak in comparison of sqlite3.Row objects. (GH-16155) 2019-09-16 20:15:18 +03:00
gescheit b9a0376b0d closes bpo-37347: Fix refcount problem in sqlite3. (GH-14268) 2019-07-12 20:15:48 -07:00
Jeroen Demeyer 59ad110d7a bpo-37547: add _PyObject_CallMethodOneArg (GH-14685) 2019-07-11 17:59:05 +09:00
Jeroen Demeyer 762f93ff2e bpo-37337: Add _PyObject_CallMethodNoArgs() (GH-14267) 2019-07-08 17:19:25 +09:00
Jeroen Demeyer 196a530e00 bpo-37483: add _PyObject_CallOneArg() function (#14558) 2019-07-04 19:31:34 +09:00
Victor Stinner c6a2320e87
bpo-37406: sqlite3 raises TypeError for wrong operation type (GH-14386)
The sqlite3 module now raises TypeError, rather than ValueError, if
operation argument type is not str: execute(), executemany() and
calling a connection.
2019-06-26 03:16:24 +02:00
Steve Dower 60419a7e96
bpo-37363: Add audit events for a range of modules (GH-14301) 2019-06-24 08:42:54 -07:00
Jeroen Demeyer 530f506ac9 bpo-36974: tp_print -> tp_vectorcall_offset and tp_reserved -> tp_as_async (GH-13464)
Automatically replace
tp_print -> tp_vectorcall_offset
tp_compare -> tp_as_async
tp_reserved -> tp_as_async
2019-05-30 19:13:39 -07:00
Aviv Palivoda e6576248e5 bpo-30262: Don't expose private objects in sqlite3 (GH-1440)
The Cache and Statement objects are undocumented and implementation
details of the sqlite3 module.

They aren't usable from pure Python code.
2019-05-09 21:05:45 +03:00
Inada Naoki 29198ea1c6
bpo-8677: use PY_SSIZE_T_CLEAN in sqlite (GH-12434)
Modules/_sqlite/cursor.c uses "y#" format.
It didn't declare PY_SSIZE_T_CLEAN, but the argument is Py_ssize_t already.
2019-03-19 22:10:18 +09:00
Zackery Spytz 842acaab13 bpo-35504: Fix segfaults and SystemErrors when deleting certain attrs. (GH-11175) 2018-12-17 16:52:45 +02:00
Serhiy Storchaka fc662ac332
bpo-32788: Better error handling in sqlite3. (GH-3723)
Propagate unexpected errors (like MemoryError and KeyboardInterrupt) to user.
2018-12-10 16:06:08 +02:00
Sergey Fedoseev 5b25f1d031 bpo-34052: Prevent SQLite functions from setting callbacks on exceptions. (GH-8113) 2018-12-05 19:50:26 +02:00
Serhiy Storchaka d4f9cf5545
bpo-33029: Fix signatures of getter and setter functions. (GH-10746)
Fix also return type for few other functions (clear, releasebuffer).
2018-11-27 19:34:35 +02:00
Serhiy Storchaka 62be74290a
bpo-33012: Fix invalid function cast warnings with gcc 8. (GH-6749)
Fix invalid function cast warnings with gcc 8
for method conventions different from METH_NOARGS, METH_O and
METH_VARARGS excluding Argument Clinic generated code.
2018-11-27 13:27:31 +02:00
Berker Peksag b10a64d117
bpo-34743: Fix test_database_source_name under SQLite 3.7.9 (GH-9426) 2018-09-20 14:14:33 +03:00
Berker Peksag 8d1e190fc5
bpo-32215: Fix performance regression in sqlite3 (GH-8511) 2018-09-20 14:10:49 +03:00
Sergey Fedoseev b229b072a9 Remove creation of a list for row_cast_map in pysqlite_cursor_init() (GH-8494)
This list is never used: if detect_types is on, this list will be
replaced with another one before row_cast_map is used, if
detect_types is off, row_cast_map is not used at all.
2018-07-31 00:11:50 +03:00
Sergey Fedoseev aee632dfbb Remove some unused code in _pysqlite_query_execute() (GH-8495)
Unused since commit ab994ed8b9.
2018-07-27 13:06:03 +03:00
Benjamin Peterson 7762e4d387
prefix internal sqlite symbols with _pysqlite_ (GH-8215) 2018-07-09 21:20:23 -07:00
Benjamin Peterson d6d4432724
delete some unused pysqlite forward declarations (GH-8211) 2018-07-09 20:41:26 -07:00
Sergey Fedoseev 0830858aee bpo-34041: Allow creating deterministic functions in Connection.create_function() (GH-8086) 2018-07-08 10:09:20 +03:00
jdemeyer 66ecefcfe7 Remove tp_print implementation (GH-7857) 2018-06-23 21:08:43 +09:00
Victor Stinner ca405017d5
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).
2018-04-30 12:22:17 +02:00
Siddhesh Poyarekar 55edd0c185 bpo-33012: Fix invalid function cast warnings with gcc 8 for METH_NOARGS. (GH-6030)
METH_NOARGS functions need only a single argument but they are cast
into a PyCFunction, which takes two arguments.  This triggers an
invalid function cast warning in gcc8 due to the argument mismatch.
Fix this by adding a dummy unused argument.
2018-04-29 21:59:33 +03:00
Takuya Akiba 030345c0bf Fix error message in sqlite connection thread check. (GH-6028) 2018-03-26 18:14:00 +03:00
Aviv Palivoda bbf7bb7a63 bpo-27645: Fix version number in 'database in transaction' fallback (GH-6131)
It was actually fixed in SQLite 3.8.8, not 3.8.7.
2018-03-18 03:48:55 +03:00
Emanuele Gaifas d7aed4102d bpo-27645: Add support for native backup facility of SQLite (GH-4238) 2018-03-11 01:08:31 +03:00
Benjamin Peterson 0a37a30037
closes bpo-32460: ensure all non-static globals have initializers (#5061) 2017-12-31 10:04:13 -08:00
Serhiy Storchaka e2f92de6a9
Add the const qualifier to "char *" variables that refer to literal strings. (#4370) 2017-11-11 13:06:26 +02:00
Anders Lorentsen a22a127458 bpo-31843: sqlite3.connect() now accepts PathLike objects as database name (#4299) 2017-11-06 16:47:43 -08:00
Oren Milman edb13ae48c bpo-31764: Prevent a crash in sqlite3.Cursor.close() in case the Cursor object is uninitialized (#3958) 2017-11-06 16:09:49 -08:00
Oren Milman e56ab746a9 bpo-31770: Prevent a crash and refleaks when calling sqlite3.Cursor.__init__() more than once (#3968) 2017-11-06 16:01:47 -08:00
Oren Milman 93c5a5df8e bpo-31740: Prevent refleaks when sqlite3.Connection.__init__() is called more than once (GH-3944) 2017-10-10 12:27:46 -07:00
Benjamin Peterson c8a6e5b18d sqlite: delete some bsddb cargo-culted code to work around Python 2.3/2.4 bugs 2017-09-22 23:25:28 -07:00
Benjamin Peterson 525269430a closes bpo-31525: require sqlite3_prepare_v2 (#3666)
This is based on
40b349cadb (diff-0489411409cd2934730e88bf7767790),
though we can be a bit more aggressive about deleting code.
2017-09-20 07:36:18 -07:00
Antoine Pitrou a6a4dc816d bpo-31370: Remove support for threads-less builds (#3385)
* Remove Setup.config
* Always define WITH_THREAD for compatibility.
2017-09-07 18:56:24 +02:00