Repository navigation
Commit 32cd0ec
committed
fix: use shutil.copy instead of copy2 to avoid SMB permission errors
shutil.copy2 calls copystat() which reads metadata (xattrs, ownership)
from the source. On SMB shares on macOS and Linux this raises
[Errno 1] Operation not permitted even with full read access, causing
the copy to be counted as an error and the WhatsApp timestamp to not
be applied.
Switch to shutil.copy (data only) and rely on set_file_times() for the
timestamp — which is what we want anyway. Isolate the utime call in its
own try/except so a failure on the destination side is logged at DEBUG
without affecting the copy count.1 parent ebc1231 commit 32cd0ec
1 file changed
Lines changed: 12 additions & 9 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
619 | 619 | | |
620 | 620 | | |
621 | 621 | | |
622 | | - | |
623 | | - | |
624 | | - | |
625 | | - | |
626 | | - | |
627 | | - | |
628 | | - | |
629 | | - | |
630 | | - | |
| 622 | + | |
631 | 623 | | |
632 | 624 | | |
633 | 625 | | |
| 626 | + | |
| 627 | + | |
| 628 | + | |
| 629 | + | |
| 630 | + | |
| 631 | + | |
| 632 | + | |
| 633 | + | |
| 634 | + | |
| 635 | + | |
| 636 | + | |
634 | 637 | | |
635 | 638 | | |
636 | 639 | | |
| |||
0 commit comments