diff --git a/mock/py/mockbuild/backend.py b/mock/py/mockbuild/backend.py index 9eaf871fb..ba5e9e854 100644 --- a/mock/py/mockbuild/backend.py +++ b/mock/py/mockbuild/backend.py @@ -820,9 +820,13 @@ def get_command(mode, checkdeps=False): def copy_build_results(self, results): self.buildroot.root_log.debug("Copying packages to result dir") ret = [] - for item in results: - shutil.copy2(item, self.buildroot.resultdir) - ret.append(os.path.join(self.buildroot.resultdir, os.path.split(item)[1])) + try: + for item in results: + shutil.copy2(item, self.buildroot.resultdir) + ret.append(os.path.join(self.buildroot.resultdir, os.path.split(item)[1])) + except OSError as err: + raise Error(f"Can not copy {item} into resultdir %s: %s", + item, self.buildroot.resultdir, str(err)) from err return ret @traceLog() diff --git a/releng/release-notes-next/rhbz-2254328.bugfix b/releng/release-notes-next/rhbz-2254328.bugfix new file mode 100644 index 000000000..4dbd48d73 --- /dev/null +++ b/releng/release-notes-next/rhbz-2254328.bugfix @@ -0,0 +1,3 @@ +No more ugly tracebacks for "no space left on device" (and similar +`OSError`s) related to copying built artifacts to `--resultdir`, +[rhbz#2261758][].