Skip to content

Commit

Permalink
Fix #120 - Catch OSError as well as ValueError
Browse files Browse the repository at this point in the history
  • Loading branch information
ndbroadbent committed Dec 23, 2018
1 parent 9cc254f commit 4b14322
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 3 deletions.
4 changes: 2 additions & 2 deletions icloudpd/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion icloudpd/download.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 4b14322

Please sign in to comment.