-
-
Notifications
You must be signed in to change notification settings - Fork 32.5k
bpo-37144: Convert path-like object to regular path #13817
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Changes from all commits
7cfe617
a307164
9d34011
cd73f1e
cb85402
dd30c0d
82882dd
14ae149
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change |
---|---|---|
|
@@ -1368,7 +1368,7 @@ def write(self, data): | |
|
||
f = BadFile() | ||
with self.assertRaises(exctype): | ||
tar = tarfile.open(tmpname, self.mode, fileobj=f, | ||
tarfile.open(tmpname, self.mode, fileobj=f, | ||
format=tarfile.PAX_FORMAT, | ||
pax_headers={'non': 'empty'}) | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. These two arguments should be indented under There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. you need to keep the same indent. |
||
self.assertFalse(f.closed) | ||
|
@@ -1421,6 +1421,12 @@ def test_file_mode(self): | |
finally: | ||
os.umask(original_umask) | ||
|
||
def test_open_by_path_object(self): | ||
# Test for issue #37144: | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. remove these comments. |
||
# broken open for stream write by path-like object | ||
with tarfile.open(pathlib.Path(tmpname), self.mode): | ||
pass | ||
|
||
class GzipStreamWriteTest(GzipTest, StreamWriteTest): | ||
pass | ||
|
||
|
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1 @@ | ||
Now `tarfile.open(path, 'w|gz')` works for path-like objects |
There was a problem hiding this comment.
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