Skip to content

Commit 51be201

Browse files
authored
Merge branch 'main' into fix-issue-133590
2 parents 7f6ba7b + c81fa2b commit 51be201

File tree

69 files changed

+760
-562
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

69 files changed

+760
-562
lines changed

Doc/c-api/import.rst

Lines changed: 0 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -16,19 +16,6 @@ Importing Modules
1616
This is a wrapper around :c:func:`PyImport_Import()` which takes a
1717
:c:expr:`const char *` as an argument instead of a :c:expr:`PyObject *`.
1818
19-
.. c:function:: PyObject* PyImport_ImportModuleNoBlock(const char *name)
20-
21-
This function is a deprecated alias of :c:func:`PyImport_ImportModule`.
22-
23-
.. versionchanged:: 3.3
24-
This function used to fail immediately when the import lock was held
25-
by another thread. In Python 3.3 though, the locking scheme switched
26-
to per-module locks for most purposes, so this function's special
27-
behaviour isn't needed anymore.
28-
29-
.. deprecated-removed:: 3.13 3.15
30-
Use :c:func:`PyImport_ImportModule` instead.
31-
3219
3320
.. c:function:: PyObject* PyImport_ImportModuleEx(const char *name, PyObject *globals, PyObject *locals, PyObject *fromlist)
3421

Doc/c-api/intro.rst

Lines changed: 9 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -826,14 +826,17 @@ frequently used builds will be described in the remainder of this section.
826826
827827
Compiling the interpreter with the :c:macro:`!Py_DEBUG` macro defined produces
828828
what is generally meant by :ref:`a debug build of Python <debug-build>`.
829-
:c:macro:`!Py_DEBUG` is enabled in the Unix build by adding
830-
:option:`--with-pydebug` to the :file:`./configure` command.
831-
It is also implied by the presence of the
832-
not-Python-specific :c:macro:`!_DEBUG` macro. When :c:macro:`!Py_DEBUG` is enabled
833-
in the Unix build, compiler optimization is disabled.
829+
830+
On Unix, :c:macro:`!Py_DEBUG` can be enabled by adding :option:`--with-pydebug`
831+
to the :file:`./configure` command. This will also disable compiler optimization.
832+
833+
On Windows, selecting a debug build (e.g., by passing the :option:`-d` option to
834+
:file:`PCbuild/build.bat`) automatically enables :c:macro:`!Py_DEBUG`.
835+
Additionally, the presence of the not-Python-specific :c:macro:`!_DEBUG` macro,
836+
when defined by the compiler, will also implicitly enable :c:macro:`!Py_DEBUG`.
834837

835838
In addition to the reference count debugging described below, extra checks are
836-
performed, see :ref:`Python Debug Build <debug-build>`.
839+
performed. See :ref:`Python Debug Build <debug-build>` for more details.
837840

838841
Defining :c:macro:`Py_TRACE_REFS` enables reference tracing
839842
(see the :option:`configure --with-trace-refs option <--with-trace-refs>`).

Doc/data/refcounts.dat

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1093,9 +1093,6 @@ PyImport_ImportModuleLevelObject:PyObject*:locals:0:???
10931093
PyImport_ImportModuleLevelObject:PyObject*:fromlist:0:???
10941094
PyImport_ImportModuleLevelObject:int:level::
10951095

1096-
PyImport_ImportModuleNoBlock:PyObject*::+1:
1097-
PyImport_ImportModuleNoBlock:const char*:name::
1098-
10991096
PyImport_ReloadModule:PyObject*::+1:
11001097
PyImport_ReloadModule:PyObject*:m:0:
11011098

Doc/data/stable_abi.dat

Lines changed: 0 additions & 1 deletion
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Doc/deprecations/c-api-pending-removal-in-3.15.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ Pending removal in Python 3.15
22
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
33

44
* The bundled copy of ``libmpdecimal``.
5-
* The :c:func:`PyImport_ImportModuleNoBlock`:
5+
* The :c:func:`!PyImport_ImportModuleNoBlock`:
66
Use :c:func:`PyImport_ImportModule` instead.
77
* :c:func:`PyWeakref_GetObject` and :c:func:`PyWeakref_GET_OBJECT`:
88
Use :c:func:`PyWeakref_GetRef` instead. The `pythoncapi-compat project

Doc/library/sqlite3.rst

Lines changed: 21 additions & 31 deletions
Original file line numberDiff line numberDiff line change
@@ -259,10 +259,10 @@ Reference
259259
Module functions
260260
^^^^^^^^^^^^^^^^
261261

262-
.. function:: connect(database, timeout=5.0, detect_types=0, \
262+
.. function:: connect(database, *, timeout=5.0, detect_types=0, \
263263
isolation_level="DEFERRED", check_same_thread=True, \
264264
factory=sqlite3.Connection, cached_statements=128, \
265-
uri=False, *, \
265+
uri=False, \
266266
autocommit=sqlite3.LEGACY_TRANSACTION_CONTROL)
267267

268268
Open a connection to an SQLite database.
@@ -355,11 +355,8 @@ Module functions
355355
.. versionchanged:: 3.12
356356
Added the *autocommit* parameter.
357357

358-
.. versionchanged:: 3.13
359-
Positional use of the parameters *timeout*, *detect_types*,
360-
*isolation_level*, *check_same_thread*, *factory*, *cached_statements*,
361-
and *uri* is deprecated.
362-
They will become keyword-only parameters in Python 3.15.
358+
.. versionchanged:: 3.15
359+
All parameters except *database* are now keyword-only.
363360

364361
.. function:: complete_statement(statement)
365362

@@ -693,7 +690,7 @@ Connection objects
693690
:meth:`~Cursor.executescript` on it with the given *sql_script*.
694691
Return the new cursor object.
695692

696-
.. method:: create_function(name, narg, func, *, deterministic=False)
693+
.. method:: create_function(name, narg, func, /, *, deterministic=False)
697694

698695
Create or remove a user-defined SQL function.
699696

@@ -719,6 +716,9 @@ Connection objects
719716
.. versionchanged:: 3.8
720717
Added the *deterministic* parameter.
721718

719+
.. versionchanged:: 3.15
720+
The first three parameters are now positional-only.
721+
722722
Example:
723723

724724
.. doctest::
@@ -733,13 +733,8 @@ Connection objects
733733
('acbd18db4cc2f85cedef654fccc4a4d8',)
734734
>>> con.close()
735735

736-
.. versionchanged:: 3.13
737-
738-
Passing *name*, *narg*, and *func* as keyword arguments is deprecated.
739-
These parameters will become positional-only in Python 3.15.
740-
741736

742-
.. method:: create_aggregate(name, n_arg, aggregate_class)
737+
.. method:: create_aggregate(name, n_arg, aggregate_class, /)
743738

744739
Create or remove a user-defined SQL aggregate function.
745740

@@ -763,6 +758,9 @@ Connection objects
763758
Set to ``None`` to remove an existing SQL aggregate function.
764759
:type aggregate_class: :term:`class` | None
765760

761+
.. versionchanged:: 3.15
762+
All three parameters are now positional-only.
763+
766764
Example:
767765

768766
.. testcode::
@@ -792,11 +790,6 @@ Connection objects
792790

793791
3
794792

795-
.. versionchanged:: 3.13
796-
797-
Passing *name*, *n_arg*, and *aggregate_class* as keyword arguments is deprecated.
798-
These parameters will become positional-only in Python 3.15.
799-
800793

801794
.. method:: create_window_function(name, num_params, aggregate_class, /)
802795

@@ -937,7 +930,7 @@ Connection objects
937930
Aborted queries will raise an :exc:`OperationalError`.
938931

939932

940-
.. method:: set_authorizer(authorizer_callback)
933+
.. method:: set_authorizer(authorizer_callback, /)
941934

942935
Register :term:`callable` *authorizer_callback* to be invoked
943936
for each attempt to access a column of a table in the database.
@@ -962,12 +955,11 @@ Connection objects
962955
.. versionchanged:: 3.11
963956
Added support for disabling the authorizer using ``None``.
964957

965-
.. versionchanged:: 3.13
966-
Passing *authorizer_callback* as a keyword argument is deprecated.
967-
The parameter will become positional-only in Python 3.15.
958+
.. versionchanged:: 3.15
959+
The only parameter is now positional-only.
968960

969961

970-
.. method:: set_progress_handler(progress_handler, n)
962+
.. method:: set_progress_handler(progress_handler, /, n)
971963

972964
Register :term:`callable` *progress_handler* to be invoked for every *n*
973965
instructions of the SQLite virtual machine. This is useful if you want to
@@ -981,12 +973,11 @@ Connection objects
981973
currently executing query and cause it to raise a :exc:`DatabaseError`
982974
exception.
983975

984-
.. versionchanged:: 3.13
985-
Passing *progress_handler* as a keyword argument is deprecated.
986-
The parameter will become positional-only in Python 3.15.
976+
.. versionchanged:: 3.15
977+
The first parameter is now positional-only.
987978

988979

989-
.. method:: set_trace_callback(trace_callback)
980+
.. method:: set_trace_callback(trace_callback, /)
990981

991982
Register :term:`callable` *trace_callback* to be invoked
992983
for each SQL statement that is actually executed by the SQLite backend.
@@ -1009,9 +1000,8 @@ Connection objects
10091000

10101001
.. versionadded:: 3.3
10111002

1012-
.. versionchanged:: 3.13
1013-
Passing *trace_callback* as a keyword argument is deprecated.
1014-
The parameter will become positional-only in Python 3.15.
1003+
.. versionchanged:: 3.15
1004+
The first parameter is now positional-only.
10151005

10161006

10171007
.. method:: enable_load_extension(enabled, /)

Doc/whatsnew/2.6.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3043,7 +3043,7 @@ Changes to Python's build process and to the C API include:
30433043

30443044
* Importing modules simultaneously in two different threads no longer
30453045
deadlocks; it will now raise an :exc:`ImportError`. A new API
3046-
function, :c:func:`PyImport_ImportModuleNoBlock`, will look for a
3046+
function, :c:func:`!PyImport_ImportModuleNoBlock`, will look for a
30473047
module in ``sys.modules`` first, then try to import it after
30483048
acquiring an import lock. If the import lock is held by another
30493049
thread, an :exc:`ImportError` is raised.

Doc/whatsnew/3.0.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -870,7 +870,7 @@ to the C API.
870870
* :c:func:`!PyNumber_Coerce`, :c:func:`!PyNumber_CoerceEx`,
871871
:c:func:`!PyMember_Get`, and :c:func:`!PyMember_Set` C APIs are removed.
872872

873-
* New C API :c:func:`PyImport_ImportModuleNoBlock`, works like
873+
* New C API :c:func:`!PyImport_ImportModuleNoBlock`, works like
874874
:c:func:`PyImport_ImportModule` but won't block on the import lock
875875
(returning an error instead).
876876

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2499,7 +2499,7 @@ Deprecated C APIs
24992499
which return a :term:`borrowed reference`.
25002500
(Soft deprecated as part of :pep:`667`.)
25012501

2502-
* Deprecate the :c:func:`PyImport_ImportModuleNoBlock` function,
2502+
* Deprecate the :c:func:`!PyImport_ImportModuleNoBlock` function,
25032503
which is just an alias to :c:func:`PyImport_ImportModule` since Python 3.3.
25042504
(Contributed by Victor Stinner in :gh:`105396`.)
25052505

Doc/whatsnew/3.15.rst

Lines changed: 12 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -143,7 +143,16 @@ New features
143143
Porting to Python 3.15
144144
----------------------
145145

146-
* TODO
146+
* :class:`sqlite3.Connection` APIs has been cleaned up.
147+
148+
* All parameters of :func:`sqlite3.connect` except *database* are now keyword-only.
149+
* The first three parameters of methods :meth:`~sqlite3.Connection.create_function`
150+
and :meth:`~sqlite3.Connection.create_aggregate` are now positional-only.
151+
* The first parameter of methods :meth:`~sqlite3.Connection.set_authorizer`,
152+
:meth:`~sqlite3.Connection.set_progress_handler` and
153+
:meth:`~sqlite3.Connection.set_trace_callback` is now positional-only.
154+
155+
(Contributed by Serhiy Storchaka in :gh:`133595`.)
147156

148157
Deprecated C APIs
149158
-----------------
@@ -155,3 +164,5 @@ Deprecated C APIs
155164
Removed C APIs
156165
--------------
157166

167+
* :c:func:`!PyImport_ImportModuleNoBlock`: deprecated alias
168+
of :c:func:`PyImport_ImportModule`.

0 commit comments

Comments
 (0)