From 53c3dd9a8d79a331764147b7b7b01f9d0a8bce71 Mon Sep 17 00:00:00 2001 From: pengyu lee Date: Mon, 11 May 2026 16:28:19 +0800 Subject: [PATCH 1/4] Fix typos in C API documentation (GH-149588) --- Doc/c-api/slots.rst | 4 ++-- Doc/c-api/synchronization.rst | 2 +- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/Doc/c-api/slots.rst b/Doc/c-api/slots.rst index b61c2f2e17bbc3..84a125cb60bae7 100644 --- a/Doc/c-api/slots.rst +++ b/Doc/c-api/slots.rst @@ -7,10 +7,10 @@ Definition slots To define :ref:`module objects ` and :ref:`classes ` using the C API, you may use -an array of *slots* -- essentally, key-value pairs that describe features +an array of *slots* -- essentially, key-value pairs that describe features of the object to create. This decouples the data from the structures used at runtime, allowing CPython --- and other Python C API implementations -- to update the stuctures without +-- and other Python C API implementations -- to update the structures without breaking backwards compatibility. This section documents slots in general. diff --git a/Doc/c-api/synchronization.rst b/Doc/c-api/synchronization.rst index 7e9894f4d692d6..6f18c047a24a92 100644 --- a/Doc/c-api/synchronization.rst +++ b/Doc/c-api/synchronization.rst @@ -238,7 +238,7 @@ are not available. .. c:function:: void PyCriticalSection_BeginMutex(PyCriticalSection *c, PyMutex *m); void PyCriticalSection2_BeginMutex(PyCriticalSection2 *c, PyMutex *m1, PyMutex *m2); - .. (These need to be in a separate section without a Stable ABI anotation.) + .. (These need to be in a separate section without a Stable ABI annotation.) To be used only as in the macro expansions listed :ref:`earlier in this section `. From 01088434512ced52d472a1857ae36e41c4e1e9c5 Mon Sep 17 00:00:00 2001 From: sobolevn Date: Mon, 11 May 2026 13:54:49 +0300 Subject: [PATCH 2/4] gh-149634: Remove deprecated and unused `tarfile.Tarfile.tarfile` attr (GH-149635) --- Doc/whatsnew/3.16.rst | 6 ++++++ Lib/tarfile.py | 20 ------------------- ...-05-10-14-10-00.gh-issue-149634.iT5cwC.rst | 1 + 3 files changed, 7 insertions(+), 20 deletions(-) create mode 100644 Misc/NEWS.d/next/Library/2026-05-10-14-10-00.gh-issue-149634.iT5cwC.rst diff --git a/Doc/whatsnew/3.16.rst b/Doc/whatsnew/3.16.rst index 967b3baf530a51..6d91d53f478d8e 100644 --- a/Doc/whatsnew/3.16.rst +++ b/Doc/whatsnew/3.16.rst @@ -140,6 +140,12 @@ sysconfig which has been deprecated since Python 3.14. Use the ``vars`` argument of :func:`sysconfig.get_paths` instead. +tarfile +------- + +* The undocumented and unused :attr:`!tarfile.TarFile.tarfile` attribute + has been deprecated since Python 3.13. + .. Add removals above alphabetically, not here at the end. diff --git a/Lib/tarfile.py b/Lib/tarfile.py index 1394a26f2096ff..772b51295fcfbe 100644 --- a/Lib/tarfile.py +++ b/Lib/tarfile.py @@ -913,7 +913,6 @@ class TarInfo(object): pax_headers = ('A dictionary containing key-value pairs of an ' 'associated pax extended header.'), sparse = 'Sparse member information.', - _tarfile = None, _sparse_structs = None, _link_target = None, ) @@ -942,24 +941,6 @@ def __init__(self, name=""): self.sparse = None # sparse member information self.pax_headers = {} # pax header information - @property - def tarfile(self): - import warnings - warnings.warn( - 'The undocumented "tarfile" attribute of TarInfo objects ' - + 'is deprecated and will be removed in Python 3.16', - DeprecationWarning, stacklevel=2) - return self._tarfile - - @tarfile.setter - def tarfile(self, tarfile): - import warnings - warnings.warn( - 'The undocumented "tarfile" attribute of TarInfo objects ' - + 'is deprecated and will be removed in Python 3.16', - DeprecationWarning, stacklevel=2) - self._tarfile = tarfile - @property def path(self): 'In pax headers, "name" is called "path".' @@ -2196,7 +2177,6 @@ def gettarinfo(self, name=None, arcname=None, fileobj=None): # Now, fill the TarInfo object with # information specific for the file. tarinfo = self.tarinfo() - tarinfo._tarfile = self # To be removed in 3.16. # Use os.stat or os.lstat, depending on if symlinks shall be resolved. if fileobj is None: diff --git a/Misc/NEWS.d/next/Library/2026-05-10-14-10-00.gh-issue-149634.iT5cwC.rst b/Misc/NEWS.d/next/Library/2026-05-10-14-10-00.gh-issue-149634.iT5cwC.rst new file mode 100644 index 00000000000000..620b66f754f5b5 --- /dev/null +++ b/Misc/NEWS.d/next/Library/2026-05-10-14-10-00.gh-issue-149634.iT5cwC.rst @@ -0,0 +1 @@ +Remove deprecated and unused :attr:`!tarfile.Tarfile.tarfile` attribute. From 833dae7c1fdc556200cbfc3e76bad4d54628042c Mon Sep 17 00:00:00 2001 From: Jonathan Dung Date: Mon, 11 May 2026 19:14:54 +0800 Subject: [PATCH 3/4] gh-146061: Clarify indent=None in json docs (GH-146095) --- Doc/library/json.rst | 2 +- Lib/json/__init__.py | 8 ++++---- 2 files changed, 5 insertions(+), 5 deletions(-) diff --git a/Doc/library/json.rst b/Doc/library/json.rst index b354e7ba534835..383ccad9df041b 100644 --- a/Doc/library/json.rst +++ b/Doc/library/json.rst @@ -211,7 +211,7 @@ Basic Usage a string (such as ``"\t"``) is used to indent each level. If zero, negative, or ``""`` (the empty string), only newlines are inserted. - If ``None`` (the default), the most compact representation is used. + If ``None`` (the default), no newlines are inserted. :type indent: int | str | None :param separators: diff --git a/Lib/json/__init__.py b/Lib/json/__init__.py index 251025efac14b8..94c177cafa0294 100644 --- a/Lib/json/__init__.py +++ b/Lib/json/__init__.py @@ -142,8 +142,8 @@ def dump(obj, fp, *, skipkeys=False, ensure_ascii=True, check_circular=True, If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent - level of 0 will only insert newlines. ``None`` is the most compact - representation. + level of 0 will only insert newlines. ``None`` is the default and gives + a representation with no newlines inserted. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is @@ -206,8 +206,8 @@ def dumps(obj, *, skipkeys=False, ensure_ascii=True, check_circular=True, If ``indent`` is a non-negative integer, then JSON array elements and object members will be pretty-printed with that indent level. An indent - level of 0 will only insert newlines. ``None`` is the most compact - representation. + level of 0 will only insert newlines. ``None`` is the default and gives + a representation with no newlines inserted. If specified, ``separators`` should be an ``(item_separator, key_separator)`` tuple. The default is ``(', ', ': ')`` if *indent* is From 4956d2be9d5e555f2cf64faed9ef39e6a797c360 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=C3=81rni=20M=C3=A1r=20J=C3=B3nsson?= Date: Mon, 11 May 2026 11:54:09 +0000 Subject: [PATCH 4/4] gh-149663: fix typo in `unittest` docs (#149670) `hastattr` -> `hasattr` --- Doc/library/unittest.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Doc/library/unittest.rst b/Doc/library/unittest.rst index c54f3e2792c388..ff619f97923325 100644 --- a/Doc/library/unittest.rst +++ b/Doc/library/unittest.rst @@ -1262,10 +1262,10 @@ Test cases | :meth:`assertNotEndsWith(a, b) | ``not a.endswith(b)`` | 3.14 | | ` | | | +---------------------------------------+--------------------------------+--------------+ - | :meth:`assertHasAttr(a, b) | ``hastattr(a, b)`` | 3.14 | + | :meth:`assertHasAttr(a, b) | ``hasattr(a, b)`` | 3.14 | | ` | | | +---------------------------------------+--------------------------------+--------------+ - | :meth:`assertNotHasAttr(a, b) | ``not hastattr(a, b)`` | 3.14 | + | :meth:`assertNotHasAttr(a, b) | ``not hasattr(a, b)`` | 3.14 | | ` | | | +---------------------------------------+--------------------------------+--------------+