diff --git a/icloudpd/base.py b/icloudpd/base.py index 4f855861e..6e56d600e 100755 --- a/icloudpd/base.py +++ b/icloudpd/base.py @@ -333,10 +333,10 @@ def photos_exception_handler(ex, retries): break try: created_date = photo.created.astimezone(get_localzone()) - except ValueError: + except (ValueError, OSError): logger.set_tqdm_description( "Could not convert photo created date to local timezone (%s)" % - photo.created, logging.ERROR, ) + photo.created, logging.ERROR) created_date = photo.created date_path = folder_structure.format(created_date) diff --git a/icloudpd/download.py b/icloudpd/download.py index debf5f119..a44e8d749 100644 --- a/icloudpd/download.py +++ b/icloudpd/download.py @@ -20,7 +20,7 @@ def update_mtime(photo, download_path): try: created_date = photo.created.astimezone( get_localzone()) - except ValueError: + except (ValueError, OSError): # We already show the timezone conversion error in base.py, # when generating the download directory. # So just return silently without touching the mtime.