Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- ======================================= FAILURES =======================================
- __________________________ TestCaseMoveCopy.test_copy_folder ___________________________
- src = '/tmp/pytest-of-adam/pytest-1/test_copy_folder0/foo'
- dst = '/tmp/pytest-of-adam/pytest-1/test_copy_folder0/[000] bar'
- def copyfile(src, dst, *, follow_symlinks=True):
- """Copy data from src to dst in the most efficient way possible.
- If follow_symlinks is not set and src is a symbolic link, a new
- symlink will be created instead of copying the file it points to.
- """
- sys.audit("shutil.copyfile", src, dst)
- if _samefile(src, dst):
- raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
- file_size = 0
- for i, fn in enumerate([src, dst]):
- try:
- st = _stat(fn)
- except OSError:
- # File most likely does not exist
- pass
- else:
- # XXX What about other special files? (sockets, devices...)
- if stat.S_ISFIFO(st.st_mode):
- fn = fn.path if isinstance(fn, os.DirEntry) else fn
- raise SpecialFileError("`%s` is a named pipe" % fn)
- if _WINDOWS and i == 0:
- file_size = st.st_size
- if not follow_symlinks and _islink(src):
- os.symlink(os.readlink(src), dst)
- else:
- try:
- > with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
- E IsADirectoryError: [Errno 21] Is a directory: '/tmp/pytest-of-adam/pytest-1/test_copy_folder0/foo'
- /usr/lib/python3.9/shutil.py:265: IsADirectoryError
- The above exception was the direct cause of the following exception:
- self = <hscommon.tests.conflict_test.TestCaseMoveCopy object at 0x7f6b5de86550>
- tmpdir = local('/tmp/pytest-of-adam/pytest-1/test_copy_folder0')
- def test_copy_folder(self, tmpdir):
- # smart_copy also works on folders
- path = Path(str(tmpdir))
- path["foo"].mkdir()
- path["bar"].mkdir()
- > smart_copy(path["foo"], path["bar"]) # no crash
- hscommon/tests/conflict_test.py:112:
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- hscommon/conflict.py:76: in smart_copy
- _smart_move_or_copy(shutil.copy, source_path, dest_path)
- hscommon/path.py:237: in wrapped
- return f(*args, **kwargs)
- hscommon/conflict.py:65: in _smart_move_or_copy
- operation(str(source_path), str(dest_path))
- /usr/lib/python3.9/shutil.py:426: in copy
- copyfile(src, dst, follow_symlinks=follow_symlinks)
- _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _ _
- src = '/tmp/pytest-of-adam/pytest-1/test_copy_folder0/foo'
- dst = '/tmp/pytest-of-adam/pytest-1/test_copy_folder0/[000] bar'
- def copyfile(src, dst, *, follow_symlinks=True):
- """Copy data from src to dst in the most efficient way possible.
- If follow_symlinks is not set and src is a symbolic link, a new
- symlink will be created instead of copying the file it points to.
- """
- sys.audit("shutil.copyfile", src, dst)
- if _samefile(src, dst):
- raise SameFileError("{!r} and {!r} are the same file".format(src, dst))
- file_size = 0
- for i, fn in enumerate([src, dst]):
- try:
- st = _stat(fn)
- except OSError:
- # File most likely does not exist
- pass
- else:
- # XXX What about other special files? (sockets, devices...)
- if stat.S_ISFIFO(st.st_mode):
- fn = fn.path if isinstance(fn, os.DirEntry) else fn
- raise SpecialFileError("`%s` is a named pipe" % fn)
- if _WINDOWS and i == 0:
- file_size = st.st_size
- if not follow_symlinks and _islink(src):
- os.symlink(os.readlink(src), dst)
- else:
- try:
- with open(src, 'rb') as fsrc, open(dst, 'wb') as fdst:
- # macOS
- if _HAS_FCOPYFILE:
- try:
- _fastcopy_fcopyfile(fsrc, fdst, posix._COPYFILE_DATA)
- return dst
- except _GiveupOnFastCopy:
- pass
- # Linux
- elif _USE_CP_SENDFILE:
- try:
- _fastcopy_sendfile(fsrc, fdst)
- return dst
- except _GiveupOnFastCopy:
- pass
- # Windows, see:
- # https://github.com/python/cpython/pull/7160#discussion_r195405230
- elif _WINDOWS and file_size > 0:
- _copyfileobj_readinto(fsrc, fdst, min(file_size, COPY_BUFSIZE))
- return dst
- copyfileobj(fsrc, fdst)
- # Issue 43219, raise a less confusing exception
- except IsADirectoryError as e:
- if os.path.exists(dst):
- raise
- else:
- > raise FileNotFoundError(f'Directory does not exist: {dst}') from e
- E FileNotFoundError: Directory does not exist: /tmp/pytest-of-adam/pytest-1/test_copy_folder0/[000] bar
- /usr/lib/python3.9/shutil.py:293: FileNotFoundError
- =============================== short test summary info ================================
- FAILED hscommon/tests/conflict_test.py::TestCaseMoveCopy::test_copy_folder - FileNotF...
- ======================= 1 failed, 565 passed, 1 xfailed in 3.90s =======================
- ERROR: InvocationError for command /home/adam/.cache/paru/clone/dupeguru-git/src/dupeguru/.tox/py39/bin/py.test core hscommon (exited with code 1)
- _______________________________________ summary ________________________________________
- SKIPPED: py36: InterpreterNotFound: python3.6
- SKIPPED: py37: InterpreterNotFound: python3.7
- SKIPPED: py38: InterpreterNotFound: python3.8
- ERROR: py39: commands failed
- ==> ERROR: A failure occurred in check().
- Aborting...
- error: failed to build 'dupeguru-git-4.1.1.r82.ge22d7d2f-1':
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement