Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
1 change: 1 addition & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -12,6 +12,7 @@ and this project adheres to [Semantic Versioning](http://semver.org/).
- Start testing on PyPy. Due to [#342](https://github.com/PyFilesystem/pyfilesystem2/issues/342)
we have to treat PyPy builds specially and allow them to fail, but at least we'll
be able to see if we break something aside from known issues with FTP tests.
- Stop patching copy with Python 3.8+ because it already uses sendfile.

## [2.4.11] - 2019-09-07

Expand Down
1 change: 1 addition & 0 deletions CONTRIBUTORS.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@ Many thanks to the following developers for contributing to this project:
- [Diego Argueta](https://github.com/dargueta)
- [Geoff Jukes](https://github.com/geoffjukes)
- [Giampaolo](https://github.com/gpcimino)
- [Louis Sautier](https://github.com/sbraz)
- [Martin Larralde](https://github.com/althonos)
- [Will McGugan](https://github.com/willmcgugan)
- [Zmej Serow](https://github.com/zmej-serow)
2 changes: 1 addition & 1 deletion fs/osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -419,7 +419,7 @@ def _check_copy(self, src_path, dst_path, overwrite=False):
raise errors.DirectoryExpected(dirname(dst_path))
return _src_path, _dst_path

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

_sendfile_error_codes = {
errno.EIO,
Expand Down
6 changes: 6 additions & 0 deletions tests/test_osfs.py
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,7 @@
import os
import shutil
import tempfile
import sys
import unittest
import pytest

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

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