Skip to content

Commit ef9c8b2

Browse files
committed
Merge branch 'main' into gh-134466
2 parents 66dc5de + b9dbf6a commit ef9c8b2

File tree

83 files changed

+1311
-464
lines changed

Some content is hidden

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

83 files changed

+1311
-464
lines changed

.github/CODEOWNERS

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -82,8 +82,8 @@ Tools/patchcheck/ @AA-Turner
8282
# Autotools
8383
configure* @erlend-aasland @corona10 @AA-Turner @emmatyping
8484
Makefile.pre.in @erlend-aasland @AA-Turner @emmatyping
85+
Modules/makesetup @erlend-aasland @AA-Turner @emmatyping
8586
Modules/Setup* @erlend-aasland @AA-Turner @emmatyping
86-
Modules/makesetup @emmatyping
8787
Tools/build/regen-configure.sh @AA-Turner
8888

8989

Doc/c-api/bytes.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -47,6 +47,10 @@ called with a non-bytes parameter.
4747
*len* on success, and ``NULL`` on failure. If *v* is ``NULL``, the contents of
4848
the bytes object are uninitialized.
4949
50+
.. deprecated:: 3.15
51+
``PyBytes_FromStringAndSize(NULL, len)`` is :term:`soft deprecated`,
52+
use the :c:type:`PyBytesWriter` API instead.
53+
5054
5155
.. c:function:: PyObject* PyBytes_FromFormat(const char *format, ...)
5256
@@ -220,6 +224,11 @@ called with a non-bytes parameter.
220224
*\*bytes* is set to ``NULL``, :exc:`MemoryError` is set, and ``-1`` is
221225
returned.
222226
227+
.. deprecated:: 3.15
228+
The function is :term:`soft deprecated`,
229+
use the :c:type:`PyBytesWriter` API instead.
230+
231+
223232
PyBytesWriter
224233
-------------
225234

Doc/c-api/init.rst

Lines changed: 16 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,6 @@ The following functions can be safely called before Python is initialized:
4141
* :c:func:`PyObject_SetArenaAllocator`
4242
* :c:func:`Py_SetProgramName`
4343
* :c:func:`Py_SetPythonHome`
44-
* :c:func:`PySys_ResetWarnOptions`
4544
* the configuration functions covered in :ref:`init-config`
4645

4746
* Informative functions:
@@ -2011,6 +2010,11 @@ Reference tracing
20112010
is set to :c:data:`PyRefTracer_DESTROY`). The **data** argument is the opaque pointer
20122011
that was provided when :c:func:`PyRefTracer_SetTracer` was called.
20132012
2013+
If a new tracing function is registered replacing the current a call to the
2014+
trace function will be made with the object set to **NULL** and **event** set to
2015+
:c:data:`PyRefTracer_TRACKER_REMOVED`. This will happen just before the new
2016+
function is registered.
2017+
20142018
.. versionadded:: 3.13
20152019
20162020
.. c:var:: int PyRefTracer_CREATE
@@ -2023,6 +2027,13 @@ Reference tracing
20232027
The value for the *event* parameter to :c:type:`PyRefTracer` functions when a Python
20242028
object has been destroyed.
20252029
2030+
.. c:var:: int PyRefTracer_TRACKER_REMOVED
2031+
2032+
The value for the *event* parameter to :c:type:`PyRefTracer` functions when the
2033+
current tracer is about to be replaced by a new one.
2034+
2035+
.. versionadded:: 3.14
2036+
20262037
.. c:function:: int PyRefTracer_SetTracer(PyRefTracer tracer, void *data)
20272038
20282039
Register a reference tracer function. The function will be called when a new
@@ -2038,6 +2049,10 @@ Reference tracing
20382049
20392050
There must be an :term:`attached thread state` when calling this function.
20402051
2052+
If another tracer function was already registered, the old function will be
2053+
called with **event** set to :c:data:`PyRefTracer_TRACKER_REMOVED` just before
2054+
the new function is registered.
2055+
20412056
.. versionadded:: 3.13
20422057
20432058
.. c:function:: PyRefTracer PyRefTracer_GetTracer(void** data)

Doc/c-api/sys.rst

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -316,14 +316,6 @@ accessible to C code. They all work with the current interpreter thread's
316316
case *name* is deleted from the sys module. Returns ``0`` on success, ``-1``
317317
on error.
318318
319-
.. c:function:: void PySys_ResetWarnOptions()
320-
321-
Reset :data:`sys.warnoptions` to an empty list. This function may be
322-
called prior to :c:func:`Py_Initialize`.
323-
324-
.. deprecated-removed:: 3.13 3.15
325-
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
326-
327319
.. c:function:: void PySys_WriteStdout(const char *format, ...)
328320
329321
Write the output string described by *format* to :data:`sys.stdout`. No

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
@@ -59,7 +59,7 @@ Pending removal in Python 3.15
5959
Set :c:member:`PyConfig.program_name` instead.
6060
* :c:func:`!Py_SetPythonHome()`:
6161
Set :c:member:`PyConfig.home` instead.
62-
* :c:func:`PySys_ResetWarnOptions`:
62+
* :c:func:`!PySys_ResetWarnOptions`:
6363
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
6464

6565
The :c:func:`Py_InitializeFromConfig` API should be used with

Doc/library/os.rst

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2630,6 +2630,13 @@ features:
26302630
Compose a raw device number from the major and minor device numbers.
26312631

26322632

2633+
.. data:: NODEV
2634+
2635+
Non-existent device.
2636+
2637+
.. versionadded:: next
2638+
2639+
26332640
.. function:: pathconf(path, name)
26342641

26352642
Return system configuration information relevant to a named file. *name*

Doc/whatsnew/3.13.rst

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2490,7 +2490,7 @@ Deprecated C APIs
24902490

24912491
* Deprecate old Python initialization functions:
24922492

2493-
* :c:func:`PySys_ResetWarnOptions`:
2493+
* :c:func:`!PySys_ResetWarnOptions`:
24942494
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
24952495
* :c:func:`!Py_GetExecPrefix`:
24962496
Get :data:`sys.exec_prefix` instead.

Doc/whatsnew/3.15.rst

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -774,6 +774,11 @@ Deprecated C APIs
774774
signed integer type of the same size is now deprecated.
775775
(Contributed by Serhiy Storchaka in :gh:`132629`.)
776776

777+
* :c:func:`PyBytes_FromStringAndSize(NULL, len) <PyBytes_FromStringAndSize>`
778+
and :c:func:`_PyBytes_Resize` are :term:`soft deprecated`,
779+
use the :c:type:`PyBytesWriter` API instead.
780+
(Contributed by Victor Stinner in :gh:`129813`.)
781+
777782
* Deprecate :c:member:`~PyComplexObject.cval` field of the the
778783
:c:type:`PyComplexObject` type.
779784
Use :c:func:`PyComplex_AsCComplex` and :c:func:`PyComplex_FromCComplex`
@@ -815,6 +820,11 @@ Removed C APIs
815820
of :c:func:`PyImport_ImportModule`.
816821
(Contributed by Bénédikt Tran in :gh:`133644`.)
817822

823+
* Remove deprecated :c:func:`!PySys_ResetWarnOptions`.
824+
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
825+
826+
(Contributed by Nikita Sobolev in :gh:`138886`.)
827+
818828
The following functions are removed in favor of :c:func:`PyConfig_Get`.
819829
The |pythoncapi_compat_project| can be used to get :c:func:`!PyConfig_Get`
820830
on Python 3.13 and older.

Include/cpython/object.h

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -463,6 +463,7 @@ PyAPI_FUNC(int) PyUnstable_Type_AssignVersionTag(PyTypeObject *type);
463463
typedef enum {
464464
PyRefTracer_CREATE = 0,
465465
PyRefTracer_DESTROY = 1,
466+
PyRefTracer_TRACKER_REMOVED = 2,
466467
} PyRefTracerEvent;
467468

468469
typedef int (*PyRefTracer)(PyObject *, PyRefTracerEvent event, void *);

0 commit comments

Comments
 (0)