Erlend Egeberg Aasland
00710e6346
bpo-43908: Make heap types converted during 3.10 alpha immutable (GH-26351)
...
* Make functools types immutable
* Multibyte codec types are now immutable
* pyexpat.xmlparser is now immutable
* array.arrayiterator is now immutable
* _thread types are now immutable
* _csv types are now immutable
* _queue.SimpleQueue is now immutable
* mmap.mmap is now immutable
* unicodedata.UCD is now immutable
* sqlite3 types are now immutable
* _lsprof.Profiler is now immutable
* _overlapped.Overlapped is now immutable
* _operator types are now immutable
* winapi__overlapped.Overlapped is now immutable
* _lzma types are now immutable
* _bz2 types are now immutable
* _dbm.dbm and _gdbm.gdbm are now immutable
2021-06-17 11:06:09 +01:00
Joe
c544393b89
bpo-44389: Fix typo in ssl deprecation warning message (GH-26754)
...
`ssl.SSL_NO_TLS` should be `ssl.OP_NO_TLS`.
2021-06-17 02:39:57 -07:00
Victor Stinner
1cd3d859a4
bpo-42972: _thread.RLock implements the GH protocol (GH-26734)
...
The _thread.RLock type now fully implement the GC protocol: add a
traverse function and the Py_TPFLAGS_HAVE_GC flag.
2021-06-15 15:09:24 +02:00
Erlend Egeberg Aasland
10a5c806d4
bpo-42064: Move sqlite3 types to global state (GH-26537)
...
* Move connection type to global state
* Move cursor type to global state
* Move prepare protocol type to global state
* Move row type to global state
* Move statement type to global state
* ADD_TYPE takes a pointer
* pysqlite_get_state is now static inline
2021-06-15 14:47:34 +02:00
Christian Heimes
bf527277d4
bpo-44389: Fix deprecation of OP_NO_TLSv1_3 (GH-26700)
...
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-13 13:46:07 +02:00
Erlend Egeberg Aasland
cb7230c7a7
bpo-44389: Remove duplicate SSL_OP_NO_TLSv1_2 flag (GH-26680)
2021-06-12 17:17:58 -03:00
Serhiy Storchaka
be8b631b7a
Add more const modifiers. (GH-26691)
2021-06-12 16:11:59 +03:00
Mark Dickinson
4a42cebf6d
bpo-44339: Fix math.pow corner case to comply with IEEE 754 (GH-26606)
...
Change the behaviour of `math.pow(0.0, -math.inf)` and `math.pow(-0.0, -math.inf)` to return positive infinity instead of raising `ValueError`. This makes `math.pow` consistent with the built-in `pow` (and the `**` operator) for this particular special case, and brings the `math.pow` special-case handling into compliance with IEEE 754.
2021-06-12 10:23:02 +01:00
Christian Heimes
e26014f1c4
bpo-44362: ssl: improve deprecation warnings and docs (GH-26646)
...
Signed-off-by: Christian Heimes <christian@python.org>
2021-06-11 09:15:48 +02:00
Ajith Ramachandran
ac867f10b4
bpo-44357:Add math.cbrt() function: Cube Root (GH-26622)
...
* Add math.cbrt() function: Cube Root
Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
Co-authored-by: Mark Dickinson <dickinsm@gmail.com>
2021-06-10 17:42:09 +01:00
Mark Shannon
31aa0dbff4
bpo-44363: Get test_capi passing with address sanitizer (GH-26639)
2021-06-10 12:37:22 +01:00
Erlend Egeberg Aasland
1c02655fb0
bpo-44329: Refactor sqlite3 statement creation (GH-26566)
...
Call SQLite API's first, and return early in case of error. At the end,
allocate the object and initialise members. We now avoid unneeded
alloc/dealloc's in case the statement creation fails.
2021-06-08 16:00:56 +01:00
Pablo Galindo
781dc76577
Fix compiler errors for unused variables (GH-26601)
2021-06-08 13:16:24 +01:00
Pablo Galindo
6d518bb3a1
bpo-44348: Revert "bpo-39573: Py_TYPE becomes a static inline function (GH-26493)" (GH-26596)
...
This reverts commit f3fa63ec75 as is
causing crashes in some Windows tests in the buildbots.
2021-06-08 12:24:40 +01:00
Erlend Egeberg Aasland
0d12f24552
bpo-44326: Remove unused members from pysqlite_Statement (GH-26564)
...
* Remove unused db member of pysqlite_Statement
* Remove unused sql method from statement object
2021-06-06 23:12:07 +01:00
Erlend Egeberg Aasland
505624e917
bpo-44327: Remove unused members from pysqlite_Connection (GH-26565)
...
* Remove timeout_started
* Remove timeout member
2021-06-06 23:11:44 +01:00
hrchu
18e9edb7b3
Update bisect docstrings (GH-26548)
2021-06-06 11:22:48 -07:00
Pablo Galindo
6e3b7cf3af
bpo-44304: Ensure the sqlite3 destructor callback is always called with the GIL held (GH-26551)
2021-06-05 23:41:11 +01:00
Pablo Galindo
fa106a685c
bpo-44304: Fix crash in the sqlite3 module when the GC clears Statement objects (GH-26545)
2021-06-05 03:50:39 +01:00
Kazantcev Andrey
2780df4781
Align comment for better readability. (GH-26192)
2021-06-04 18:41:23 -03:00
Erlend Egeberg Aasland
7459208de1
bpo-44315: Remove unused connection argument from pysqlite_step() (GH-26535)
2021-06-04 21:42:20 +01:00
Erlend Egeberg Aasland
006fd869e4
bpo-43853: Handle sqlite3_value_text() errors (GH-25422)
2021-06-04 19:34:00 +01:00
Erlend Egeberg Aasland
3446516ffa
bpo-44042: Optimize sqlite3 begin transaction (GH-25908)
2021-06-03 22:24:25 +01:00
Erlend Egeberg Aasland
f461a7fc3f
bpo-42862: Use functools.lru_cache iso. _sqlite.Cache in sqlite3 module (GH-24203)
...
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
2021-06-03 20:59:26 +01:00
Victor Stinner
f3fa63ec75
bpo-39573: Py_TYPE becomes a static inline function (GH-26493)
...
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.
2021-06-03 18:42:59 +02:00
Erlend Egeberg Aasland
d88b47b5a3
bpo-42213: Remove redundant cyclic GC hack in sqlite3 (GH-26517)
...
The sqlite3 module now fully implements the GC protocol, so there's no
need for this workaround anymore.
- Add and use managed resource helper for connections using TESTFN
- Sort test imports
- Split open-tests into their own test case
Automerge-Triggered-By: GH:vstinner
2021-06-03 09:38:19 -07:00
Erlend Egeberg Aasland
82ad22a97d
bpo-42213: Check connection in sqlite3.Connection.__enter__ (GH-26512)
...
Try to harden connection close:
- add tests that exercise stuff against a closed database
- add wrapper for sqlite3_close_v2()
- check connection on __enter__
- explicitly free pending statements before close()
- sqlite3_close_v2() always returns SQLITE_OK
2021-06-03 17:53:47 +02:00
stratakis
bdb56902a3
bpo-44285: getpath.c: Assert that env_file is NULL during an error check (GH-26486)
...
This was flagged by a static analyzer, but the logic of why this is NULL on error is hard to follow for humans as well.
2021-06-02 16:54:33 +02:00
Erlend Egeberg Aasland
fbf25b8c0d
bpo-44165: pysqlite_statement_create now returns a Py object, not an int (GH-26484)
...
GH-26206 was broken by GH-26475.
2021-06-02 14:22:15 +01:00
Erlend Egeberg Aasland
a384b6c040
bpo-44165: Optimise sqlite3 statement preparation by passing string size (GH-26206)
2021-06-02 13:26:06 +01:00
Erlend Egeberg Aasland
fffa0f92ad
bpo-42972: Track sqlite3 statement objects (GH-26475)
...
Allocate and track statement objects in pysqlite_statement_create.
By allocating and tracking creation of statement object in
pysqlite_statement_create(), the caller does not need to worry about GC
syncronization, and eliminates the possibility of getting a badly
created object. All related fault handling is moved to
pysqlite_statement_create().
Co-authored-by: Victor Stinner <vstinner@python.org>
2021-06-01 12:47:37 +02:00
Serhiy Storchaka
a6a2065881
bpo-44260: Do not read system entropy without need in Random() (GH-26455)
2021-05-31 23:24:20 +03:00
Victor Stinner
142e5c5445
bpo-44263: Fix _decimal and _testcapi GC protocol (GH-26464)
...
* _testcapi.heapgctype: implement a traverse function since the type
is defined with Py_TPFLAGS_HAVE_GC.
* _decimal: PyDecSignalDictMixin_Type is no longer defined with
Py_TPFLAGS_HAVE_GC since it has no traverse function.
2021-05-31 13:10:31 +02:00
Erlend Egeberg Aasland
d1124b09e8
bpo-42972: Fix sqlite3 traverse/clear functions (GH-26452)
2021-05-31 10:24:56 +02:00
Hai Shi
4b20f2574d
bpo-42972: Fully implement GC protocol for xxlimited (GH-26451)
2021-05-31 09:51:19 +02:00
Pablo Galindo
8b4312b909
bpo-44252: Correctly implement gc support for SSLError objects (GH-26439)
2021-05-29 00:29:52 +01:00
Ken Jin
490b638e63
bpo-42972: Fix GC assertion error in _winapi by untracking Overlapped earlier (GH(26429)
2021-05-28 18:29:19 +02:00
Ken Jin
0fa282c55f
bpo-42972: Fully support GC for _winapi.Overlapped (GH-26381)
2021-05-28 11:06:46 +02:00
Erlend Egeberg Aasland
3f8d332527
bpo-42972: Fully implement GC protocol for functools LRU cache (GH-26423)
2021-05-28 11:02:42 +02:00
Erlend Egeberg Aasland
8994e9c2cd
bpo-42972: Fully implement GC protocol for functools keywrapper and partial types (GH-26363)
2021-05-28 10:41:16 +02:00
Inada Naoki
28be3191a9
bpo-44256: Do not expose _functools._list_elem_type (GH-26416)
...
It is internal use only type.
2021-05-28 14:09:32 +09:00
Erlend Egeberg Aasland
f4b70c22c8
bpo-42972: Fully support GC protocol for _operator heap types (GH-26371)
2021-05-27 22:59:07 +02:00
Erlend Egeberg Aasland
fba42d1188
bpo-42972: Fully implement GC protocol for re types (GH-26368)
2021-05-27 19:23:07 +02:00
Erlend Egeberg Aasland
318adeba78
bpo-42972: Fully support GC for mmap heap types (GH-26373)
2021-05-27 17:53:59 +02:00
Erlend Egeberg Aasland
4d7f8f9f7f
bpo-42972: Fully support GC protocol for _queue.SimpleQueue (GH-26372)
2021-05-27 17:50:12 +02:00
Erlend Egeberg Aasland
dcb8786a98
bpo-42972: Fully implement GC protocol for ssl heap types (GH-26370)
2021-05-27 09:50:09 +02:00
Erlend Egeberg Aasland
6ef5ba391d
bpo-42972: Fully support GC for hashlib heap types (GH-26374)
2021-05-27 09:48:19 +02:00
Erlend Egeberg Aasland
59af59c2df
bpo-42972: Fully support GC for pyexpat, unicodedata, and dbm/gdbm heap types (GH-26376)
...
* bpo-42972: pyexpat
* bpo-42972: unicodedata
* bpo-42972: dbm/gdbm
2021-05-27 17:29:00 +10:00
Victor Stinner
3e7ee02327
bpo-42161: mathmodule.c: move _PyLong_GetOne() loop invariant (GH-26391)
...
Move _PyLong_GetZero() and _PyLong_GetOne() loop invariants outside
loops in functions:
* math.comb()
* math.gcd()
* math.lcm()
* math.perm()
2021-05-27 00:51:07 +02:00
Gabriele N. Tornetta
90a6c07cb2
bpo-43879: Add native_thread_id field to PyThreadState (GH-25458)
2021-05-26 16:40:14 +02:00