icloud-photos-downloader / icloud_photos_downloader

A command-line tool to download photos from iCloud
MIT License
6.77k stars 552 forks source link

.part file remains when encountered insufficient disk space #968

Open iowk opened 6 days ago

iowk commented 6 days ago

Overview

If downloading fails because of insufficient disk space, .part file remains and is not removed.

Steps to Reproduce

  1. Sync iCloud Photos on a device with insufficient disk space.
  2. Downloading should fail on some files, logging IOError while writing...

Expected Behavior

The .part file should be deleted after downloading fails.

Actual Behavior

The .part file remains.

Context

I think we can add a try-finally block in download_response_to_path to remove the .part file on error.

AndreyNikiforov commented 5 days ago

Thanks for reporting. Yes, .part files will be left on the drive if app crashes. A number of thoughts on the subject:

Seems that simple try-catch wrapping and silent file deletion may cover most probable case (space issues). It will not hurt re-auth hypothetical case.