Skip to content

Commit 79066ec

Browse files
committed
Merge remote-tracking branch 'upstream/main' into cputime
2 parents 1767b39 + baf7470 commit 79066ec

25 files changed

+380
-195
lines changed

Doc/c-api/init.rst

Lines changed: 0 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:

Doc/c-api/init_config.rst

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1278,6 +1278,11 @@ PyConfig
12781278
12791279
Default: ``0``.
12801280
1281+
.. deprecated-removed:: 3.15 3.17
1282+
1283+
The :option:`-b` and :option:`!-bb` options will become no-op in 3.17.
1284+
:c:member:`~PyConfig.bytes_warning` member will be removed in 3.17.
1285+
12811286
.. c:member:: int warn_default_encoding
12821287
12831288
If non-zero, emit a :exc:`EncodingWarning` warning when :class:`io.TextIOWrapper`

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/reference/simple_stmts.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -465,8 +465,8 @@ Deletion of a target list recursively deletes each target, from left to right.
465465

466466
Deletion of a name removes the binding of that name from the local or global
467467
namespace, depending on whether the name occurs in a :keyword:`global` statement
468-
in the same code block. If the name is unbound, a :exc:`NameError` exception
469-
will be raised.
468+
in the same code block. Trying to delete an unbound name raises a
469+
:exc:`NameError` exception.
470470

471471
.. index:: pair: attribute; deletion
472472

Doc/using/cmdline.rst

Lines changed: 9 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -254,6 +254,15 @@ Miscellaneous options
254254
.. versionchanged:: 3.5
255255
Affects also comparisons of :class:`bytes` with :class:`int`.
256256

257+
.. deprecated:: 3.15
258+
259+
Deprecate :option:`-b` and :option:`!-bb` command line options
260+
and schedule them to become no-op in Python 3.17.
261+
These were primarily helpers for the Python 2 -> 3 transition.
262+
Starting with Python 3.17, no :exc:`BytesWarning` will be raised
263+
for these cases; use a type checker instead.
264+
265+
257266
.. option:: -B
258267

259268
If given, Python won't try to write ``.pyc`` files on the

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: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -537,6 +537,17 @@ module_name
537537
Deprecated
538538
==========
539539

540+
CLI
541+
---
542+
543+
* Deprecate :option:`-b` and :option:`!-bb` command line options
544+
and schedule them to become no-op in Python 3.17.
545+
These were primarily helpers for the Python 2 -> 3 transition.
546+
Starting with Python 3.17, no :exc:`BytesWarning` will be raised
547+
for these cases; use a type checker instead.
548+
549+
(Contributed by Nikita Sobolev in :gh:`136355`.)
550+
540551
hashlib
541552
-------
542553

@@ -775,6 +786,10 @@ Deprecated C APIs
775786
:c:func:`_Py_c_abs` are :term:`soft deprecated`.
776787
(Contributed by Sergey B Kirpichev in :gh:`128813`.)
777788

789+
* :c:member:`~PyConfig.bytes_warning` is deprecated
790+
since 3.15 and will be removed in 3.17.
791+
(Contributed by Nikita Sobolev in :gh:`136355`.)
792+
778793

779794
.. Add C API deprecations above alphabetically, not here at the end.
780795
@@ -800,6 +815,11 @@ Removed C APIs
800815
of :c:func:`PyImport_ImportModule`.
801816
(Contributed by Bénédikt Tran in :gh:`133644`.)
802817

818+
* Remove deprecated :c:func:`!PySys_ResetWarnOptions`.
819+
Clear :data:`sys.warnoptions` and :data:`!warnings.filters` instead.
820+
821+
(Contributed by Nikita Sobolev in :gh:`138886`.)
822+
803823
The following functions are removed in favor of :c:func:`PyConfig_Get`.
804824
The |pythoncapi_compat_project| can be used to get :c:func:`!PyConfig_Get`
805825
on Python 3.13 and older.

Include/sysmodule.h

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,8 +23,6 @@ PyAPI_FUNC(void) PySys_WriteStderr(const char *format, ...)
2323
PyAPI_FUNC(void) PySys_FormatStdout(const char *format, ...);
2424
PyAPI_FUNC(void) PySys_FormatStderr(const char *format, ...);
2525

26-
Py_DEPRECATED(3.13) PyAPI_FUNC(void) PySys_ResetWarnOptions(void);
27-
2826
PyAPI_FUNC(PyObject *) PySys_GetXOptions(void);
2927

3028
#ifdef __cplusplus

0 commit comments

Comments
 (0)