jm289765 / highlights-to-obsidian

Calibre plugin for sending highlights to Obsidian.md markdown editor
MIT License
75 stars 4 forks source link

OverflowError: mktime argument out of range #2

Closed vu-truong-personal closed 1 year ago

vu-truong-personal commented 1 year ago

I got this error when pressing "Send New of Selected Books":

calibre 6.13 embedded-python: True Windows-10-10.0.22621-SP0 Windows ('64bit', 'WindowsPE') ('Windows', '10', '10.0.22621') Python 3.10.1 Windows: ('10', '10.0.22621', 'SP0', 'Multiprocessor Free') Interface language: None Successfully initialized third party plugins: Highlights to Obsidian (1, 1, 0) Traceback (most recent call last): File "calibre_plugins.highlights_to_obsidian.menu_button", line 82, in send_new_selected File "calibre_plugins.highlights_to_obsidian.button_actions", line 124, in send_new_selected_highlights OverflowError: mktime argument out of range

jm289765 commented 1 year ago

My guess is that you set the year too high or too low in the config menu. It's also possible that your computer doesn't allow mktime for inputs at the beginning of the Unix epoch.

According to the Python docs for mktime:

The earliest date for which it can generate a time is platform-dependent.

On my Windows 11 laptop, the year has to be between 1970 and 3000.

I'll adjust the default time and validate the config menu input.

vu-truong-personal commented 1 year ago

I just updated to the new version and tried again, it seems to be fine for now. Many thanks!