Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Commit cd73f1e

Browse files
committed
Change os.path.abspath on os.fspath
1 parent 9d34011 commit cd73f1e

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

Lib/tarfile.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1468,7 +1468,7 @@ def __init__(self, name=None, mode="r", fileobj=None, format=None,
14681468
if hasattr(fileobj, "mode"):
14691469
self._mode = fileobj.mode
14701470
self._extfileobj = True
1471-
self.name = os.path.abspath(name) if name else None
1471+
self.name = os.fspath(name) if name else None
14721472
self.fileobj = fileobj
14731473

14741474
# Init attributes.
@@ -1943,7 +1943,7 @@ def add(self, name, arcname=None, recursive=True, *, filter=None):
19431943
arcname = name
19441944

19451945
# Skip if somebody tries to archive the archive...
1946-
if self.name is not None and os.path.abspath(name) == self.name:
1946+
if self.name is not None and os.fspath(name) == self.name:
19471947
self._dbg(2, "tarfile: Skipped %r" % name)
19481948
return
19491949

0 commit comments

Comments
 (0)