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

Pubdate does not allow for books published < 1 AD #58

Open
jd7h opened this issue Oct 19, 2021 · 2 comments
Open

Pubdate does not allow for books published < 1 AD #58

jd7h opened this issue Oct 19, 2021 · 2 comments
Labels
bug Something isn't working

Comments

@jd7h
Copy link
Owner

jd7h commented Oct 19, 2021

Problem arose when importing GoodReads books that included Chinese/Greek classics.

@jd7h jd7h added the bug Something isn't working label Oct 19, 2021
@jd7h
Copy link
Owner Author

jd7h commented Oct 19, 2021

Books that triggered this error:
Oeconomicus by Xenophon (362 BC)
Tao Te Ching by Lao Zu (600 BC)

@jd7h
Copy link
Owner Author

jd7h commented Oct 19, 2021

Error:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/home/judith/git/josephine/scripts/goodreads_importer.py", line 92, in main
    goodreads_record_to_book(record)
  File "/home/judith/git/josephine/scripts/goodreads_importer.py", line 32, in goodreads_record_to_book
    book.pubdate = datetime.datetime(year=int(record['Original Publication Year']), day=1, month=1)
ValueError: year -600 is out of range

jd7h added a commit that referenced this issue Oct 19, 2021
Change models to also include pubyear, an int
Only add pubdate if pubyear > 1
Fixes bug mentioned in issue #58
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

1 participant