fix: clean up empty file after failed wl-paste clipboard extraction
When wl-paste produces empty output, the destination file was left on disk as a 0-byte orphan. Now explicitly removed before returning False.
This commit is contained in:
parent
c754135965
commit
58b756f04c
1 changed files with 1 additions and 0 deletions
|
|
@ -254,6 +254,7 @@ def _wayland_save(dest: Path) -> bool:
|
||||||
)
|
)
|
||||||
|
|
||||||
if not dest.exists() or dest.stat().st_size == 0:
|
if not dest.exists() or dest.stat().st_size == 0:
|
||||||
|
dest.unlink(missing_ok=True)
|
||||||
return False
|
return False
|
||||||
|
|
||||||
# BMP needs conversion to PNG (common in WSLg where only BMP
|
# BMP needs conversion to PNG (common in WSLg where only BMP
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue