You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
fs.copy.copy_file: Breaking changes between Python 3.7 and Python 3.8 #496
raising IsADirectoryError: [Errno 21] Is a directory: '/tmp/42'.
However, the same snippet succeds in Python 3.8.0 with the same version of fs. It appears that while running on Python 3.7.x the dst path must have the file name, while on 3.8.0 it can be a directory. Is this expected?
Thanks for the report! That's definitely not expected, as we try to get a consistent behaviour on all platforms.
Internally, OSFS.copy uses shutil.copy2 if it is supported, which changed in Python 3.8 with added support for platform-specific copy operations. I'd think for consistency PyFilesystem2 would want to check that dst_path is not a directory.
changed the title [-]fs.copy.copy_file: Breaking changes between Python 3.7 to Python 3.8[/-][+]fs.copy.copy_file: Breaking changes between Python 3.7 and Python 3.8[/+]on Oct 11, 2021
Activity
althonos commentedon Oct 6, 2021
Thanks for the report! That's definitely not expected, as we try to get a consistent behaviour on all platforms.
Internally,
OSFS.copyusesshutil.copy2if it is supported, which changed in Python 3.8 with added support for platform-specific copy operations. I'd think for consistency PyFilesystem2 would want to check thatdst_pathis not a directory.[-]fs.copy.copy_file: Breaking changes between Python 3.7 to Python 3.8[/-][+]fs.copy.copy_file: Breaking changes between Python 3.7 and Python 3.8[/+]