2 from shutil
import * # noqa: F403
4 from .compat_utils
import passthrough_module
6 passthrough_module(__name__
, 'shutil')
12 if sys
.platform
.startswith('freebsd'):
17 # Workaround for PermissionError when using restricted ACL mode on FreeBSD
18 def copy2(src
, dst
, *args
, **kwargs
):
19 if os
.path
.isdir(dst
):
20 dst
= os
.path
.join(dst
, os
.path
.basename(src
))
21 shutil
.copyfile(src
, dst
, *args
, **kwargs
)
23 shutil
.copystat(src
, dst
, *args
, **kwargs
)
24 except PermissionError
as e
:
25 if e
.errno
!= getattr(errno
, 'EPERM', None):
29 def move(*args
, copy_function
=copy2
, **kwargs
):
30 return shutil
.move(*args
, copy_function
=copy_function
, **kwargs
)