mirror of
https://github.com/calibrain/shelfmark.git
synced 2026-10-05 16:31:14 +01:00
make os mv and cp commands non interactive (#430)
- fix(fs): handle NFS permission errors with robust fallback - Catch PermissionError/OSError(EPERM) in atomic_move and atomic_copy - Implement layered fallback: shutil.copyfile (content only) -> system mv/cp - Add _perform_nfs_fallback and _system_op helpers to reduce duplication - Set fallback logging to DEBUG to reduce spam on NFS mounts - make os mv and cp commands non interactive (-f)
This commit is contained in:
@@ -63,7 +63,7 @@ def _system_op(op: str, source: Path, dest: Path) -> None:
|
||||
"""Execute system command (mv or cp) as final fallback."""
|
||||
logger.info(f"Attempting system {op} as final fallback: {source} -> {dest}")
|
||||
subprocess.run(
|
||||
[op, str(source), str(dest)],
|
||||
[op, "-f", str(source), str(dest)],
|
||||
check=True,
|
||||
capture_output=True,
|
||||
text=True
|
||||
|
||||
Reference in New Issue
Block a user