Add book regex crash on published date before 1900
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
When I try a regex to extract the published date from filename, I get an error if it's before 1900.
You can reproduce this error by going to Add Book configuration and try this regex with that filename.
Regex used:
(?P<published>.+) - (?P<author>[^_]+)
Name of the file:
year - anything.pdf
These gave me errors
1790 - anything.pdf
1791 - anything.pdf
1899 - anything.pdf
But this works well:
1900 - anything.pdf
Details of error:
calibre, version 2.20.0
ERROR: Excepción no considerada: <b>ValueError<
calibre 2.20 isfrozen: True is64bit: False
Windows-
32bit process running on 64bit windows
('Windows', '7', '6.1.7601')
Python 2.7.9
Windows: ('7', '6.1.7601', 'SP1', 'Multiprocessor Free')
Traceback (most recent call last):
File "site-packages\
ValueError: year=1790 is before 1900; the datetime strftime() methods require year >= 1900
I've only tried it on Windows 7, but I think it could affect other OS.
Fixed in branch master. The fix will be in the next release. calibre is usually released every Friday.
status fixreleased