Skip to content

Commit 17d2ea5

Browse files
authored
Merge branch 'master' into manifest
2 parents af3002a + 3e02968 commit 17d2ea5

File tree

3 files changed

+8
-1
lines changed

3 files changed

+8
-1
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -14,6 +14,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
1414
be able to see if we break something aside from known issues with FTP tests.
1515
- Include docs in source distributions as well the whole tests folder,
1616
ensuring `conftest.py` is present, fixes [#364](https://github.com/PyFilesystem/pyfilesystem2/issues/364).
17+
- Stop patching copy with Python 3.8+ because it already uses sendfile.
1718

1819
## [2.4.11] - 2019-09-07
1920

fs/osfs.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -419,7 +419,7 @@ def _check_copy(self, src_path, dst_path, overwrite=False):
419419
raise errors.DirectoryExpected(dirname(dst_path))
420420
return _src_path, _dst_path
421421

422-
if sys.version_info[:2] <= (3, 8) and sendfile is not None:
422+
if sys.version_info[:2] < (3, 8) and sendfile is not None:
423423

424424
_sendfile_error_codes = {
425425
errno.EIO,

tests/test_osfs.py

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6,6 +6,7 @@
66
import os
77
import shutil
88
import tempfile
9+
import sys
910
import unittest
1011
import pytest
1112

@@ -88,6 +89,11 @@ def test_expand_vars(self):
8889
self.assertNotIn("TYRIONLANISTER", fs2.getsyspath("/"))
8990

9091
@pytest.mark.skipif(osfs.sendfile is None, reason="sendfile not supported")
92+
@pytest.mark.skipif(
93+
sys.version_info >= (3, 8),
94+
reason="the copy function uses sendfile in Python 3.8+, "
95+
"making the patched implementation irrelevant",
96+
)
9197
def test_copy_sendfile(self):
9298
# try copying using sendfile
9399
with mock.patch.object(osfs, "sendfile") as sendfile:

0 commit comments

Comments
 (0)