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

Skip to content
Closed
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Convert path object to raw path for all usages
  • Loading branch information
0x29a committed Jun 7, 2019
commit 14ae1490c5a78a58f41f53ad738157b9f472c774
2 changes: 1 addition & 1 deletion Lib/tarfile.py
Original file line number Diff line number Diff line change
Expand Up @@ -1454,6 +1454,7 @@ def __init__(self, name=None, mode="r", fileobj=None, format=None,
self.mode = mode
self._mode = modes[mode]

name = os.fspath(name) if name else None
if not fileobj:
if self.mode == "a" and not os.path.exists(name):
# Create nonexistent files in append mode.
Expand All @@ -1469,7 +1470,6 @@ def __init__(self, name=None, mode="r", fileobj=None, format=None,
self._mode = fileobj.mode
self._extfileobj = True

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove this line, we have to get a minimalist diff for the merge. Thank you

name = os.fspath(name) if name else None
self.name = os.path.abspath(name) if name else None
self.fileobj = fileobj

Expand Down