mirror of
https://github.com/python/cpython.git
synced 2026-06-11 04:12:11 +00:00
gh-149634: Remove deprecated and unused tarfile.Tarfile.tarfile attr (GH-149635)
This commit is contained in:
parent
53c3dd9a8d
commit
0108843451
3 changed files with 7 additions and 20 deletions
|
|
@ -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.
|
||||
|
||||
|
||||
|
|
|
|||
|
|
@ -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:
|
||||
|
|
|
|||
|
|
@ -0,0 +1 @@
|
|||
Remove deprecated and unused :attr:`!tarfile.Tarfile.tarfile` attribute.
|
||||
Loading…
Add table
Add a link
Reference in a new issue