Skip to content

Commit d1ce7f9

Browse files
committed
Fix Sphinx warnings in 'What's New In Python 3.12'
1 parent 4e2ef71 commit d1ce7f9

File tree

3 files changed

+47
-43
lines changed

3 files changed

+47
-43
lines changed

Doc/library/gzip.rst

+4
Original file line numberDiff line numberDiff line change
@@ -143,6 +143,10 @@ The module defines the following items:
143143
:func:`time.time` and the :attr:`~os.stat_result.st_mtime` attribute of
144144
the object returned by :func:`os.stat`.
145145

146+
.. attribute:: name
147+
148+
The filename.
149+
146150
.. versionchanged:: 3.1
147151
Support for the :keyword:`with` statement was added, along with the
148152
*mtime* constructor argument and :attr:`mtime` attribute.

Doc/whatsnew/3.12.rst

+42-42
Original file line numberDiff line numberDiff line change
@@ -239,7 +239,7 @@ inspect
239239
-------
240240

241241
* Add :func:`inspect.markcoroutinefunction` to mark sync functions that return
242-
a :term:`coroutine` for use with :func:`iscoroutinefunction`.
242+
a :term:`coroutine` for use with :func:`inspect.iscoroutinefunction`.
243243
(Contributed Carlton Gibson in :gh:`99247`.)
244244

245245
pathlib
@@ -264,7 +264,7 @@ dis
264264
* Pseudo instruction opcodes (which are used by the compiler but
265265
do not appear in executable bytecode) are now exposed in the
266266
:mod:`dis` module.
267-
:data:`~dis.HAVE_ARGUMENT` is still relevant to real opcodes,
267+
:opcode:`HAVE_ARGUMENT` is still relevant to real opcodes,
268268
but it is not useful for pseudo instructions. Use the new
269269
:data:`~dis.hasarg` collection instead.
270270
(Contributed by Irit Katriel in :gh:`94216`.)
@@ -383,7 +383,7 @@ Optimizations
383383
(Contributed by Kevin Modzelewski in :gh:`90536`.)
384384

385385
* Speed up the regular expression substitution (functions :func:`re.sub` and
386-
:func:`re.subn` and corresponding :class:`re.Pattern` methods) for
386+
:func:`re.subn` and corresponding :class:`!re.Pattern` methods) for
387387
replacement strings containing group references by 2--3 times.
388388
(Contributed by Serhiy Storchaka in :gh:`91524`.)
389389

@@ -440,7 +440,7 @@ Deprecated
440440
:exc:`ImportWarning`).
441441
(Contributed by Brett Cannon in :gh:`65961`.)
442442

443-
* The :meth:`~asyncio.DefaultEventLoopPolicy.get_event_loop` method of the
443+
* The :meth:`~asyncio.get_event_loop` method of the
444444
default event loop policy now emits a :exc:`DeprecationWarning` if there
445445
is no current event loop set and it decides to create one.
446446
(Contributed by Serhiy Storchaka and Guido van Rossum in :gh:`100160`.)
@@ -485,23 +485,23 @@ Modules (see :pep:`594`):
485485

486486
APIs:
487487

488-
* :class:`configparser.LegacyInterpolation` (:gh:`90765`)
488+
* :class:`!configparser.LegacyInterpolation` (:gh:`90765`)
489489
* :func:`locale.getdefaultlocale` (:gh:`90817`)
490-
* :meth:`turtle.RawTurtle.settiltangle` (:gh:`50096`)
491-
* :func:`unittest.findTestCases` (:gh:`50096`)
492-
* :func:`unittest.makeSuite` (:gh:`50096`)
493-
* :func:`unittest.getTestCaseNames` (:gh:`50096`)
494-
* :class:`webbrowser.MacOSX` (:gh:`86421`)
490+
* :meth:`!turtle.RawTurtle.settiltangle` (:gh:`50096`)
491+
* :func:`!unittest.findTestCases` (:gh:`50096`)
492+
* :func:`!unittest.makeSuite` (:gh:`50096`)
493+
* :func:`!unittest.getTestCaseNames` (:gh:`50096`)
494+
* :class:`!webbrowser.MacOSX` (:gh:`86421`)
495495

496496
Pending Removal in Python 3.14
497497
------------------------------
498498

499499
* Deprecated the following :mod:`importlib.abc` classes, scheduled for removal in
500500
Python 3.14:
501501

502-
* :class:`importlib.abc.ResourceReader`
503-
* :class:`importlib.abc.Traversable`
504-
* :class:`importlib.abc.TraversableResources`
502+
* :class:`!importlib.abc.ResourceReader`
503+
* :class:`!importlib.abc.Traversable`
504+
* :class:`!importlib.abc.TraversableResources`
505505

506506
Use :mod:`importlib.resources.abc` classes instead:
507507

@@ -510,7 +510,7 @@ Pending Removal in Python 3.14
510510

511511
(Contributed by Jason R. Coombs and Hugo van Kemenade in :gh:`93963`.)
512512

513-
* Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable
513+
* Creating immutable types (:data:`Py_TPFLAGS_IMMUTABLETYPE`) with mutable
514514
bases using the C API.
515515

516516
* ``__package__`` and ``__cached__`` will cease to be set or taken
@@ -639,11 +639,11 @@ Removed
639639

640640
* Remove ``io.OpenWrapper`` and ``_pyio.OpenWrapper``, deprecated in Python
641641
3.10: just use :func:`open` instead. The :func:`open` (:func:`io.open`)
642-
function is a built-in function. Since Python 3.10, :func:`_pyio.open` is
642+
function is a built-in function. Since Python 3.10, :func:`!_pyio.open` is
643643
also a static method.
644644
(Contributed by Victor Stinner in :gh:`94169`.)
645645

646-
* Remove the :func:`ssl.RAND_pseudo_bytes` function, deprecated in Python 3.6:
646+
* Remove the :func:`!ssl.RAND_pseudo_bytes` function, deprecated in Python 3.6:
647647
use :func:`os.urandom` or :func:`ssl.RAND_bytes` instead.
648648
(Contributed by Victor Stinner in :gh:`94199`.)
649649

@@ -653,13 +653,13 @@ Removed
653653
extension if it was not present.
654654
(Contributed by Victor Stinner in :gh:`94196`.)
655655

656-
* Remove the :func:`ssl.match_hostname` function. The
657-
:func:`ssl.match_hostname` was deprecated in Python 3.7. OpenSSL performs
656+
* Remove the :func:`!ssl.match_hostname` function.
657+
It was deprecated in Python 3.7. OpenSSL performs
658658
hostname matching since Python 3.7, Python no longer uses the
659-
:func:`ssl.match_hostname` function.
659+
:func:`!ssl.match_hostname` function.
660660
(Contributed by Victor Stinner in :gh:`94199`.)
661661

662-
* Remove the :func:`locale.format` function, deprecated in Python 3.7:
662+
* Remove the :func:`!locale.format` function, deprecated in Python 3.7:
663663
use :func:`locale.format_string` instead.
664664
(Contributed by Victor Stinner in :gh:`94226`.)
665665

@@ -669,9 +669,9 @@ Removed
669669
a C implementation of :func:`~hashlib.pbkdf2_hmac()` which is faster.
670670
(Contributed by Victor Stinner in :gh:`94199`.)
671671

672-
* :mod:`xml.etree`: Remove the ``ElementTree.Element.copy()`` method of the
672+
* :mod:`xml.etree.ElementTree`: Remove the ``ElementTree.Element.copy()`` method of the
673673
pure Python implementation, deprecated in Python 3.10, use the
674-
:func:`copy.copy` function instead. The C implementation of :mod:`xml.etree`
674+
:func:`copy.copy` function instead. The C implementation of :mod:`xml.etree.ElementTree`
675675
has no ``copy()`` method, only a ``__copy__()`` method.
676676
(Contributed by Victor Stinner in :gh:`94383`.)
677677

@@ -680,10 +680,10 @@ Removed
680680
:pep:`451` for the rationale.
681681
(Contributed by Victor Stinner in :gh:`94379`.)
682682

683-
* Remove the :func:`ssl.wrap_socket` function, deprecated in Python 3.7:
683+
* Remove the :func:`!ssl.wrap_socket` function, deprecated in Python 3.7:
684684
instead, create a :class:`ssl.SSLContext` object and call its
685685
:class:`ssl.SSLContext.wrap_socket` method. Any package that still uses
686-
:func:`ssl.wrap_socket` is broken and insecure. The function neither sends a
686+
:func:`!ssl.wrap_socket` is broken and insecure. The function neither sends a
687687
SNI TLS extension nor validates server hostname. Code is subject to `CWE-295
688688
<https://cwe.mitre.org/data/definitions/295.html>`_: Improper Certificate
689689
Validation.
@@ -850,7 +850,7 @@ New Features
850850
The :const:`Py_TPFLAGS_HAVE_VECTORCALL` flag is now removed from a class
851851
when the class's :py:meth:`~object.__call__` method is reassigned.
852852
This makes vectorcall safe to use with mutable types (i.e. heap types
853-
without the :const:`immutable <Py_TPFLAGS_IMMUTABLETYPE>` flag).
853+
without the immutable flag, :const:`Py_TPFLAGS_IMMUTABLETYPE`).
854854
Mutable types that do not override :c:member:`~PyTypeObject.tp_call` now
855855
inherit the ``Py_TPFLAGS_HAVE_VECTORCALL`` flag.
856856
(Contributed by Petr Viktorin in :gh:`93274`.)
@@ -883,7 +883,7 @@ New Features
883883
(Contributed by Andrew Frost in :gh:`92257`.)
884884

885885
* The C API now permits registering callbacks via :c:func:`PyDict_AddWatcher`,
886-
:c:func:`PyDict_AddWatch` and related APIs to be called whenever a dictionary
886+
:c:func:`PyDict_Watch` and related APIs to be called whenever a dictionary
887887
is modified. This is intended for use by optimizing interpreters, JIT
888888
compilers, or debuggers.
889889
(Contributed by Carl Meyer in :gh:`91052`.)
@@ -958,9 +958,9 @@ Porting to Python 3.12
958958
supported, but does not fully support multiple inheritance
959959
(:gh:`95589`), and performance may be worse.
960960
Classes declaring :const:`Py_TPFLAGS_MANAGED_DICT` should call
961-
:c:func:`_PyObject_VisitManagedDict` and :c:func:`_PyObject_ClearManagedDict`
961+
:c:func:`!_PyObject_VisitManagedDict` and :c:func:`!_PyObject_ClearManagedDict`
962962
to traverse and clear their instance's dictionaries.
963-
To clear weakrefs, call :c:func:`PyObject_ClearWeakRefs`, as before.
963+
To clear weakrefs, call :c:func:`!PyObject_ClearWeakRefs`, as before.
964964

965965
* The :c:func:`PyUnicode_FSDecoder` function no longer accepts bytes-like
966966
paths, like :class:`bytearray` and :class:`memoryview` types: only the exact
@@ -993,17 +993,17 @@ Deprecated
993993
* :c:var:`Py_HashRandomizationFlag`: use :c:member:`PyConfig.use_hash_seed`
994994
and :c:member:`PyConfig.hash_seed`
995995
* :c:var:`Py_IsolatedFlag`: use :c:member:`PyConfig.isolated`
996-
* :c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyConfig.legacy_windows_fs_encoding`
996+
* :c:var:`Py_LegacyWindowsFSEncodingFlag`: use :c:member:`PyPreConfig.legacy_windows_fs_encoding`
997997
* :c:var:`Py_LegacyWindowsStdioFlag`: use :c:member:`PyConfig.legacy_windows_stdio`
998-
* :c:var:`Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
999-
* :c:var:`Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig.filesystem_errors`
1000-
* :c:var:`Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:`Py_PreInitialize`)
998+
* :c:var:`!Py_FileSystemDefaultEncoding`: use :c:member:`PyConfig.filesystem_encoding`
999+
* :c:var:`!Py_FileSystemDefaultEncodeErrors`: use :c:member:`PyConfig.filesystem_errors`
1000+
* :c:var:`!Py_UTF8Mode`: use :c:member:`PyPreConfig.utf8_mode` (see :c:func:`Py_PreInitialize`)
10011001

10021002
The :c:func:`Py_InitializeFromConfig` API should be used with
10031003
:c:type:`PyConfig` instead.
10041004
(Contributed by Victor Stinner in :gh:`77782`.)
10051005

1006-
* Creating :c:data:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable
1006+
* Creating :const:`immutable types <Py_TPFLAGS_IMMUTABLETYPE>` with mutable
10071007
bases is deprecated and will be disabled in Python 3.14.
10081008

10091009
* The ``structmember.h`` header is deprecated, though it continues to be
@@ -1053,15 +1053,15 @@ Removed
10531053

10541054
* Legacy Unicode APIs have been removed. See :pep:`623` for detail.
10551055

1056-
* :c:macro:`PyUnicode_WCHAR_KIND`
1057-
* :c:func:`PyUnicode_AS_UNICODE`
1058-
* :c:func:`PyUnicode_AsUnicode`
1059-
* :c:func:`PyUnicode_AsUnicodeAndSize`
1060-
* :c:func:`PyUnicode_AS_DATA`
1061-
* :c:func:`PyUnicode_FromUnicode`
1062-
* :c:func:`PyUnicode_GET_SIZE`
1063-
* :c:func:`PyUnicode_GetSize`
1064-
* :c:func:`PyUnicode_GET_DATA_SIZE`
1056+
* :c:macro:`!PyUnicode_WCHAR_KIND`
1057+
* :c:func:`!PyUnicode_AS_UNICODE`
1058+
* :c:func:`!PyUnicode_AsUnicode`
1059+
* :c:func:`!PyUnicode_AsUnicodeAndSize`
1060+
* :c:func:`!PyUnicode_AS_DATA`
1061+
* :c:func:`!PyUnicode_FromUnicode`
1062+
* :c:func:`!PyUnicode_GET_SIZE`
1063+
* :c:func:`!PyUnicode_GetSize`
1064+
* :c:func:`!PyUnicode_GET_DATA_SIZE`
10651065

10661066
* Remove the ``PyUnicode_InternImmortal()`` function and the
10671067
``SSTATE_INTERNED_IMMORTAL`` macro.

Misc/NEWS.d/3.10.0a2.rst

+1-1
Original file line numberDiff line numberDiff line change
@@ -888,7 +888,7 @@ file descriptors.
888888
.. nonce: JUPE59
889889
.. section: C API
890890
891-
:c:data:`Py_FileSystemDefaultEncodeErrors` and :c:data:`Py_UTF8Mode` are
891+
:c:data:`!Py_FileSystemDefaultEncodeErrors` and :c:data:`!Py_UTF8Mode` are
892892
available again in limited API.
893893

894894
..

0 commit comments

Comments
 (0)