Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Year is Out of Range Bug #74

Closed
mrpintcom opened this issue May 29, 2018 · 5 comments
Closed

Year is Out of Range Bug #74

mrpintcom opened this issue May 29, 2018 · 5 comments

Comments

@mrpintcom
Copy link

I'm trying to import all my photos from icloud. When it gets to a certain point it fails with the error:

/home/luke/Pictures/2016/09/24/IMG_3101-original.JPG already exists.:  55%|▌| 18392/33335 [09:22<08:43, 28.56it/s]Traceback (most recent call last):
  File "./download_photos.py", line 304, in <module>
    download()
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 722, in __call__
    return self.main(*args, **kwargs)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 697, in main
    rv = self.invoke(ctx)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 895, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/local/lib/python2.7/dist-packages/click/core.py", line 535, in invoke
    return callback(*args, **kwargs)
  File "./download_photos.py", line 152, in download
    created_date = photo.created.astimezone(get_localzone())
  File "/usr/local/lib/python2.7/dist-packages/pyicloud/services/photos.py", line 451, in created
    return self.asset_date
  File "/usr/local/lib/python2.7/dist-packages/pyicloud/services/photos.py", line 457, in asset_date
    tz=pytz.utc)
ValueError: year is out of range
@mrpintcom
Copy link
Author

I opened an issue in pyicloud because it looked like it could be rooted there?

@evenwebb
Copy link

evenwebb commented May 29, 2018 via email

@mrpintcom
Copy link
Author

@evenwebb Fantastic idea! Thanks for the advice, I'll try this afternoon! I'm almost certain that will fix the issue.

@mrpintcom
Copy link
Author

That worked, thanks so much.

@ndbroadbent
Copy link
Collaborator

ndbroadbent commented Jul 21, 2018

Thanks for reporting this issue! I've fixed this with a workaround - picklepete/pyicloud#184. If the date is invalid, I'll just set it to 1/1/1970 (the earliest valid date in Unix time).

I've also decided to store a copy of the pyicloud library in this repo (under ./vendor/pyicloud-0.9.1.zip), because some people were having problems installing my fork from github. The requirements.txt has also been updated to point to this vendored copy.

So I've just updated that with this bugfix, and you can start using the fix by running git pull, then pip install -r requirements.txt

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants