[issue45126] [sqlite3] cleanup and harden connection init

2021-09-07 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Quoting Petr Viktorin in PR 27940, https://github.com/python/cpython/pull/27940#discussion_r703424148: - db is not set to NULL if init fails. - This segfaults for me: import sqlite3 conn = sqlite3.connect(':memory:') conn.execute(&#x

[issue45089] [sqlite3] the trace callback does not raise exceptions on error

2021-09-07 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Quoting Petr from PR 28133: Without the ability to tell SQLite to abort on trace failure, I doubt we can do much better than the current behavior. Getting an exception and having the data inserted seems quite irregular. Closing this issue as won&#

[issue44991] [sqlite3] cleanup callbacks (GIL handling, naming, ...)

2021-09-07 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26634 pull_request: https://github.com/python/cpython/pull/28209 ___ Python tracker <https://bugs.python.org/issue44

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-07 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +26648 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28227 ___ Python tracker <https://bugs.python.org/issu

[issue45089] [sqlite3] the trace callback does not raise exceptions on error

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > It *would* be possible to improve the documentation, though. +1 -- ___ Python tracker <https://bugs.python.org/issu

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I modified your second example slightly: ``` import sqlite3 conn = sqlite3.connect(":memory:") conn.text_factory=bytes conn.row_factory = sqlite3.Row cursor = conn.execute("CREATE TABLE foo (bar)") numbers = range(4) cursor.executem

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Note: I ran that with PR 28227. OTOH: I do agree that there's a lot of pitfalls here, especially in the future. In the long run, it is probably best to deprecate reinit, and disable it in Python

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Modifying the loops to also print the values: first fetch b'0' b'1' second fetch 2 3 -- ___ Python tracker <https://bug

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FYI, I've expanded the reinit tests and added a deprecation warning to the PR. -- ___ Python tracker <https://bugs.python.org/is

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Great, thanks. -- ___ Python tracker <https://bugs.python.org/issue45126> ___ ___ Python-bugs-list mailing list Unsub

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > If we deprecate but keep the buggy behavior it as it is, (1) is not needed. > Less work for both us and the users. Indeed. There's still a ref leak I'd like to take care of, though: if the first audit fails, da

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26651 pull_request: https://github.com/python/cpython/pull/28231 ___ Python tracker <https://bugs.python.org/issue45

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26654 pull_request: https://github.com/python/cpython/pull/28234 ___ Python tracker <https://bugs.python.org/issue45

[issue45126] [sqlite3] cleanup and harden connection init

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'll save the cleanup till Python 3.13 dev is started. I've opened a PR for fixing the ref leak (should be backported), and a draft PR for deprecating Connection and Cursor reinitialisation. --

[issue38371] Tkinter: deprecate the split() method

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland nosy_count: 1.0 -> 2.0 pull_requests: +26657 pull_request: https://github.com/python/cpython/pull/28237 ___ Python tracker <https://bugs.python.org/issu

[issue45089] [sqlite3] the trace callback does not raise exceptions on error

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26658 stage: resolved -> patch review pull_request: https://github.com/python/cpython/pull/28238 ___ Python tracker <https://bugs.python.org/issu

[issue45138] [sqlite3] expand bound values in traced statements if possible

2021-09-08 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : For SQLite 3.14.0 and newer, we're using the v2 trace API. This means that the trace callback receives a pointer to the sqlite3_stmt object. We can use the sqlite3_stmt pointer to retrieve expanded SQL string. The following stat

[issue45138] [sqlite3] expand bound values in traced statements if possible

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +26660 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28240 ___ Python tracker <https://bugs.python.org/issu

[issue45138] [sqlite3] expand bound values in traced statements when possible

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- title: [sqlite3] expand bound values in traced statements if possible -> [sqlite3] expand bound values in traced statements when possible ___ Python tracker <https://bugs.python.org/issu

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-09-08 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I did some experiments using the connection object as a "backref" in the callback context, but it seems that the GC does not play well with such ref circles; I ended up with a lot of ref leaks (yes, I modified the traverse and clear slots to

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-09-08 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26661 pull_request: https://github.com/python/cpython/pull/28242 ___ Python tracker <https://bugs.python.org/issue42

[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-09-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Updated title to include sqlite3.Cursor as well, since cursors and connections are very much entwined. -- title: [sqlite3] cleanup and harden connection init -> [sqlite3] cleanup and harden Connection and Cursor __ini

[issue43853] [sqlite3] Improve sqlite3_value_text() error handling

2021-09-10 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Serhiy, I believe I've addressed your review remarks on PR 27642. Would you mind taking a look at it again if you have time? -- ___ Python tracker <https://bugs.python.org/is

[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-09-12 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26712 pull_request: https://github.com/python/cpython/pull/28298 ___ Python tracker <https://bugs.python.org/issue45

[issue5846] Deprecate obsolete functions in unittest

2021-09-12 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26713 pull_request: https://github.com/python/cpython/pull/28299 ___ Python tracker <https://bugs.python.org/issue5

[issue45177] Use shared test loader when possible when running test suite

2021-09-12 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Use unittest.defaultTestLoader instead of unittest.TestLoader() when possible, to avoid creating unnecessary many instances. -- components: Tests messages: 401674 nosy: erlendaasland, serhiy.storchaka priority: normal severity: normal status

[issue45177] Use shared test loader when possible when running test suite

2021-09-12 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +26715 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28301 ___ Python tracker <https://bugs.python.org/issu

[issue45177] Use shared test loader when possible when running test suite

2021-09-13 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Also, TestLoader has mutable attribute "errors". I am not sure that it is > good idea to share it between unrelated tests. Noted. I'm closing this. -- resolution: -> rejected stage: patch review -> reso

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-09-13 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45113> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0

2021-09-17 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks, Steve. I'll pull in main and see how the CI fares. -- ___ Python tracker <https://bugs.python.org/is

[issue5846] Deprecate obsolete functions in unittest

2021-09-17 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: _makeLoader is not deprecated yet, so we might keep this open a little bit more. -- ___ Python tracker <https://bugs.python.org/issue5

[issue5846] Deprecate obsolete functions in unittest

2021-09-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > It is an internal function. We can remove it without deprecation. How convenient :) -- ___ Python tracker <https://bugs.python.org/iss

[issue45116] Performance regression 3.10b1 and later on Windows: Py_DECREF() not inlined in PGO build

2021-09-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45116> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45243] [sqlite3] add support for changing connection limits

2021-09-19 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : I propose to add wrappers for the SQLite sqlite3_limit() C API. Using this API, it is possible to query and set limits on a connection basis. This will make it easier (and faster) to test various corner cases in the test suite without relying on

[issue45041] [sqlite3] simplify executescript()

2021-09-19 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks for reviewing, Pablo! -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue45243] [sqlite3] add support for changing connection limits

2021-09-19 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Christian, how about adding an audit event for something like sqlite3.Connection.setlimit()? My initial thought is: yes. -- nosy: +christian.heimes ___ Python tracker <https://bugs.python.org/issue45

[issue45243] [sqlite3] add support for changing connection limits

2021-09-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +26864 stage: -> patch review pull_request: https://github.com/python/cpython/pull/28463 ___ Python tracker <https://bugs.python.org/issu

[issue43760] The DISPATCH() macro is not as efficient as it could be (move PyThreadState.use_tracing)

2021-09-20 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue43760> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue44848] Upgrade macOS and Windows installers to use SQLite 3.36.0

2021-09-20 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26886 pull_request: https://github.com/python/cpython/pull/28490 ___ Python tracker <https://bugs.python.org/issue44

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Now that pysqlite_statement_reset() is only used in cursor.c, I suggest to move it to cursor.c and make it a static function. -- ___ Python tracker <https://bugs.python.org/issue44

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45255> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-21 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Could it instead throw a FileNotFoundError if the db simply doesn't exist at > the specified path? We pass the database path pretty much straight to sqlite3_open_v2(), via the os.PathLike interface, so any errors we get come straight from SQ

[issue45255] sqlite3.connect() should check if the sqlite file exists and throw a FileNotFoundError if it doesn't

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- status: open -> pending ___ Python tracker <https://bugs.python.org/issue45255> ___ ___ Python-bugs-list mailing list Un

[issue45041] [sqlite3] simplify executescript()

2021-09-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26906 pull_request: https://github.com/python/cpython/pull/28509 ___ Python tracker <https://bugs.python.org/issue45

[issue44958] [sqlite3] only reset statements when needed

2021-09-21 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > Now that pysqlite_statement_reset() is only used in cursor.c, I suggest to > move it to cursor.c and make it a static function. I'll wait until PR 25984 is merged before opening a PR for relocating pysqlite_stat

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Ouch, that's quite a regression! Thanks for the heads up! I'll have a look at it right away. -- ___ Python tracker <https://bugs.python.o

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'm unable to reproduce this regression on my machine (macOS, debug build, no optimisations). Are you able to reproduce, Ken? -- ___ Python tracker <https://bugs.python.org/is

[issue44958] [sqlite3] only reset statements when needed

2021-09-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > I'm unable to reproduce this regression on my machine (macOS, debug build, no > optimisations) [...] Correction: I _am_ able to reproduce this. -- ___ Python tracker <https://bugs.python.

[issue44958] [sqlite3] only reset statements when needed

2021-09-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Explicitly resetting statements when we're done with them removes the performance regression; SQLite works more efficient when we keep the number of non-reset statements low. -- ___ Python tracker &

[issue44958] [sqlite3] only reset statements when needed

2021-09-26 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'll revert PR 27844 for now (except the tests). Since SQLite works better when we keep the number of non-reset statements to a minimum, we need to ensure that we reset statements when we're done with them (sqlite3_step() returns SQLITE_DONE o

[issue44958] [sqlite3] only reset statements when needed

2021-09-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +26956 pull_request: https://github.com/python/cpython/pull/28574 ___ Python tracker <https://bugs.python.org/issue44

[issue45089] [sqlite3] the trace callback does not raise exceptions on error

2021-10-04 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- resolution: wont fix -> fixed ___ Python tracker <https://bugs.python.org/issue45089> ___ ___ Python-bugs-list mailing list Un

[issue45335] Default TIMESTAMP converter in sqlite3 ignores time zone

2021-10-04 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Replacing the timestamp converter with datetime.datetime.fromisoformat sounds good to me. -- ___ Python tracker <https://bugs.python.org/issue45

[issue29410] Moving to SipHash-1-3

2021-10-05 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue29410> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-05 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > [...] if sqlite3 starts returning aware datetimes, existing code might break. True. > [...] perhaps this could be fixed in conjunction with changing sqlite3's API > to allow per-database converters and adapters Another option could be to

[issue45374] sqlite3: Add configure option to set or auto-detect rpath to sqlite3 libs

2021-10-05 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45374> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-05 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > I'd be interested in working on this myself, if you think it's something that > a new CPython contributor could handle. Please, go ahead :) However, I think this should be discussed on Discourse first (open a topic in the Core Deve

[issue45335] Default TIMESTAMP converter in sqlite3 ignores UTC offset

2021-10-07 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: See also: - bpo-19065: sqlite3 timestamp adapter chokes on timezones - bpo-26651 Deprecate register_adapter() and register_converter() in sqlite3 (Adding Berker to nosy list.) -- nosy: +berker.peksag

[issue26651] Deprecate register_adapter() and register_converter() in sqlite3

2021-10-07 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Yes, deprecating the preconfigured adapters and converters, but keeping the ability to register adapters/converters sounds like a very good idea to me. As you point out, Marc-Andre, they are application specific. Also, implementing converters and

[issue26651] Deprecate register_adapter() and register_converter() in sqlite3

2021-10-07 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- versions: +Python 3.11 -Python 3.6 ___ Python tracker <https://bugs.python.org/issue26651> ___ ___ Python-bugs-list mailin

[issue45243] [sqlite3] add support for changing connection limits

2021-10-07 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +27123 pull_request: https://github.com/python/cpython/pull/28790 ___ Python tracker <https://bugs.python.org/issue45

[issue16379] SQLite error code not exposed to python

2021-10-07 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +27128 pull_request: https://github.com/python/cpython/pull/28809 ___ Python tracker <https://bugs.python.org/issue16

[issue26387] Crash calling sqlite3_close with invalid pointer

2021-10-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FYI: We've been using sqlite3_close_v2(), when available, since 2017 (see 86a670543ff97d52fd9b8ca0477f8b6d27ee946d), but we now call it with GIL held. I'm leaning towards closing this as out-of-date. There is no reproducer, there has been no mo

[issue26387] Crash calling sqlite3_close with invalid pointer

2021-10-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: >From https://sqlite.org/c3ref/close.html: If sqlite3_close_v2() is called with unfinalized prepared statements, unclosed BLOB handlers, and/or unfinished sqlite3_backups, it returns SQLITE_OK regardless, but instead of deallocating the datab

[issue45512] [sqlite3] simplify "isolation level"

2021-10-18 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : While working on bpo-45126 / GH-28227 (and while working on the AC conversion, bpo-40956), I've been slightly frustrated on the implementation of sqlite3 "isolation level". The code is messy, and we've got two connection members tha

[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-10-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: +1! See also bpo-43502 -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45490> ___ ___ Python-bug

[issue45490] [meta][C API] Avoid C macro pitfalls and usage of static inline functions

2021-10-18 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Previous discussion on Discourse: https://discuss.python.org/t/what-to-do-with-unsafe-macros/7771 -- ___ Python tracker <https://bugs.python.org/issue45

[issue45512] [sqlite3] simplify "isolation level"

2021-10-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27325 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29053 ___ Python tracker <https://bugs.python.org/issu

[issue36073] sqlite crashes with converters mutating cursor

2021-10-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +27326 pull_request: https://github.com/python/cpython/pull/29054 ___ Python tracker <https://bugs.python.org/issue36

[issue39410] CentOS 6.10 SQLite 3.30.1 - _sqlite3 builds successfully but is removed because it cannot be imported.

2021-10-19 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: If you are building CPython against a specific version of SQLite (for example one you've compiled yourself), make sure that you adjust _both_ CFLAGS and LDFLAGS. Note: since bpo-40810 / GH-24106, SQLite 3.7.15 or newer is required. Closing this as

[issue43851] Optimise SQLite builds on macOS and Windows

2021-10-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- resolution: -> fixed stage: patch review -> resolved status: open -> closed ___ Python tracker <https://bugs.python.or

[issue44927] [sqlite3] proposal: add sqlite3.Cursor.insert() method

2021-10-19 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: I'm closing this for now. As I see it, there is little added value, and it would be hard to make a good API for all invariants. If this idea surfaces again, we can always reopen this issue. Thanks for you interest in improving CP

[issue42064] Convert sqlite3 to multi-phase initialisation (PEP 489)

2021-10-19 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +27341 pull_request: https://github.com/python/cpython/pull/29073 ___ Python tracker <https://bugs.python.org/issue42

[issue43239] PyCFunction_New is not exported with PyAPI_FUNC

2021-10-20 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: It seems to me that this issue can be closed as fixed. Do you have further PR's for this, Petr? -- nosy: +erlendaasland status: open -> pending ___ Python tracker <https://bugs.python.org

[issue45459] Limited API support for Py_buffer

2021-10-21 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45459> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FYI, see bpo-43916 regarding the introduction and rationale of introducing Py_TPFLAGS_DISALLOW_INSTANTIATION. Slightly related: bpo-43908 -- ___ Python tracker <https://bugs.python.org/issue45

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: >> Can I do something for this pending PEP? > > Ask Victor, he should know more. But as far as I know, no one started on it > yet. Quoting PEP 630 (active PEP): Whenever this PEP mentions extension modules, the advice also applies to b

[issue43974] Define Py_BUILD_CORE_MODULE in extensions instead of setup.py and Modules/Setup

2021-10-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > I no longer think that we should define Py_BUILD_CORE_MODULE > unconditionally. Instead I propose to move the defines into each C module. +1. Explicit is nice. -- nosy: +erlendaasland ___ Python t

[issue45126] [sqlite3] cleanup and harden Connection and Cursor __init__

2021-10-22 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- pull_requests: +27435 pull_request: https://github.com/python/cpython/pull/29160 ___ Python tracker <https://bugs.python.org/issue45

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: > My understanding is that this entire class of code changes has been put on > hold pending Steering Council approval. Can you please point me to the official SC statement regarding this? I cannot find it. > It represents a great deal of code

[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-22 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Currently, we call _pysqlite_seterror() if sqlite3_open_v2() returns != SQLITE_OK. However, if a memory failure occurs during sqlite3_open_v2(), the database handle is explicitly set to NULL. This _may_ cause _pysqlite_seterror() to segfault, since we

[issue45581] [sqlite3] raise MemoryError if sqlite3_open_v2() returns SQLITE_NOMEM

2021-10-22 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27444 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29171 ___ Python tracker <https://bugs.python.org/issu

[issue41682] [Windows] test_asyncio: Proactor test_sendfile_close_peer_in_the_middle_of_receiving failure

2021-10-22 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: New failure today: https://github.com/python/cpython/runs/3979900415?check_suite_focus=true test_sendfile_close_peer_in_the_middle_of_receiving (test.test_asyncio.test_sendfile.SelectEventLoopTests) ... ok

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Thanks, Petr. Yes, that is correct. PEP 630 (I assume you meant 630, not 640) still describes the _rationale_ very well. I guess what's needed is a Standards Track PEP based on PEP 630 (IIUC). -- ___ P

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Petr: > Hmm, the best I can find is > https://github.com/python/steering-council/blob/main/updates/2021-02-steering-council-update.md#february-08 Perfect, thanks! Christian: Thanks for your input. If this was a discussion on Discourse, I'd

[issue45113] [subinterpreters][C API] Add a new function to create PyStructSequence from Heap.

2021-10-23 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: Oh, I found PEP 3121 (Extension Module Initialization and Finalization). It is a Standards Track PEP and it is accepted. The abstract is pretty short. Let me just repost it here, for convenience: Extension module initialization currently has a few

[issue45608] [sqlite3] some DB-API attributes are undocumented

2021-10-25 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Some DB-API 2.0 attributes are undocumented: - apilevel - threadsafety - paramstyle These attributes should be documented. See also: - bpo-8196 - https://discuss.python.org/t/is-sqlite3-threadsafety-the-same-thing-as-sqlite3-threadsafe-from-the-c

[issue45608] [sqlite3] some DB-API attributes are undocumented

2021-10-25 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27482 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29219 ___ Python tracker <https://bugs.python.org/issu

[issue37095] [Feature Request]: Add zstd support in tarfile

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue37095> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45612] [doc] add sqlite3 module docstring

2021-10-26 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Currently, the sqlite3 module docstring is the old pysqlite copyright comment in the start of Lib/sqlite3/__init__.py. This is not very helpful to the general user. Suggesting to add a more helpful docstring, a la the 're' or 'array'

[issue45612] [doc] add sqlite3 module docstring

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27488 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29224 ___ Python tracker <https://bugs.python.org/issu

[issue10572] Move test sub-packages to Lib/test

2021-10-26 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: A side-effect of keeping tests inside the package, is that they appear in the package contents module docstring, which may be slightly confusing to new users. >>> import sqlite3 >>> help(sqlite3) Help on package sqlite3: NAME sq

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +serhiy.storchaka ___ Python tracker <https://bugs.python.org/issue45613> ___ ___ Python-bugs-list mailing list Unsub

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +paul.moore ___ Python tracker <https://bugs.python.org/issue45613> ___ ___ Python-bugs-list mailing list Unsubscribe:

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
New submission from Erlend E. Aasland : Currently, the sqlite3 DB-API 2.0 attribute 'threadsafety' is hard-coded to 1, meaning "threads may share the module, but not connections". This is not always true, since it depends on the default SQLite threaded mode, selected at c

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: FYI, it is also possible to change the threaded mode using sqlite3_config(), however that API is not exposed to the sqlite3 module, and there is no plans for doing so in the near future :) -- ___ Python

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- keywords: +patch pull_requests: +27491 stage: -> patch review pull_request: https://github.com/python/cpython/pull/29227 ___ Python tracker <https://bugs.python.org/issu

[issue45613] [sqlite3] set threadsafety attribute based on default SQLite threaded mode

2021-10-26 Thread Erlend E. Aasland
Erlend E. Aasland added the comment: BTW, I've verified that the overhead of adding this query is negligible. $ python -m pyperf compare_to --min-speed 1 main.json patched.json Benchmark hidden because not significant (1): sqlite_synth git switch - Switched to branch 'main'

[issue45614] traceback of exception with non-unicode __module__

2021-10-26 Thread Erlend E. Aasland
Change by Erlend E. Aasland : -- nosy: +erlendaasland ___ Python tracker <https://bugs.python.org/issue45614> ___ ___ Python-bugs-list mailing list Unsubscribe:

<    2   3   4   5   6   7   8   9   >