Alright, I had this really long explanation written out as I figured it out, but after way too long narrowing it down to exactly what’s occurring, I think I can rewrite this and make it easier to understand and replicate.
First, this has been happening for a long time. It was just annoying to figure out and so I never could understand why it was happening until yesterday it suddenly occurred what it might be. I honestly thought it was a pure calibre problem for a while.
Second, this is a problem with the FanFicFare Update (Date) column in my case it's named FFFCheck. Calibre Column Type is set to Date. The problem is an error I get a lot. It's a calibre error, now that I've had my epiphany and spent time narrowing it down, it looks like it comes from the interaction from FFF.
…So here we go.
I've got a calibre test database (and program) stripped down. Just running Calibre x64 and FanFicFare, both latest version. My test database has 2 files in it. a FFF story, in this case I just grabbed something tiny off ff.net. The second is a non FFF epub.
The search I'm using in a database is: #fffcheck:<5daysago first time no problem.
Highlight both, update. Of course the second file doesn't work. In Update Existing Dialog it says No Story URL Found. I update the files. Since the second has nothing to do with FFF, and there's no URL, I've never considered it might cause a problem.
Update - doesn't matter if the Fanfic updates or not, as long as both files metadata is updated in the fffcheck column.
Search again: #fffcheck:<5daysago ...... and Error: ValueError: astimezone() cannot be applied to a naive datetime (full error below)
Spoiler:
Code:
calibre, version 4.12.0
ERROR: Unhandled exception: <b>ValueError</b>:astimezone() cannot be applied to a naive datetime
calibre 4.12 [64bit] Portable embedded-python: True is64bit: True
Windows-10-10.0.18362-SP0 Windows ('64bit', 'WindowsPE')
('Windows', '10', '10.0.18362')
Python 2.7.16+
Windows: ('10', '10.0.18362', 'SP0', u'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: Count Pages (1, 9, 0) && FanFicFare (3, 17, 3)
Traceback (most recent call last):
File "site-packages\calibre\gui2\library\views.py", line 1237, in search_proxy
File "site-packages\calibre\gui2\library\models.py", line 491, in search
File "site-packages\calibre\db\view.py", line 272, in search
File "site-packages\calibre\db\view.py", line 307, in search_getting_ids
File "site-packages\calibre\db\cache.py", line 62, in call_func_with_lock
File "site-packages\calibre\db\cache.py", line 1015, in search
File "site-packages\calibre\db\search.py", line 883, in __call__
File "site-packages\calibre\db\search.py", line 925, in _do_search
File "site-packages\calibre\db\search.py", line 490, in parse
File "site-packages\calibre\utils\search_query_parser.py", line 342, in parse
File "site-packages\calibre\utils\search_query_parser.py", line 363, in _parse
File "site-packages\calibre\utils\search_query_parser.py", line 371, in evaluate
File "site-packages\calibre\utils\search_query_parser.py", line 417, in evaluate_token
File "site-packages\calibre\utils\search_query_parser.py", line 421, in _get_matches
File "site-packages\calibre\db\search.py", line 581, in get_matches
File "site-packages\calibre\db\search.py", line 207, in __call__
File "site-packages\calibre\utils\date.py", line 226, in dt_as_local
ValueError: astimezone() cannot be applied to a naive datetime
I've tried dozens of variations. This has no problem whatsoever when everything is a FFF story (with URL), but anything missing a URL effects this as far as I can tell. Even files that were FFF downloaded and had the URL removed because of say rewrite (and removal of all the old chapters to do it, so I kept the old version). That's probably why I couldn't narrow this problem down and it just seemed to randomly occur, I rarely ever get non FFF stories selected when I try and update FFF stories. Still, it's an error that's happened a lot for me, and I'd love to see it fixed.