Add book regex crash on published date before 1900

Bug #1424607 reported by Xoan Antelo on 2015-02-23
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
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</b>:year=1790 is before 1900; the datetime strftime() methods require year >= 1900

calibre 2.20 isfrozen: True is64bit: False
Windows-7-6.1.7601-SP1 Windows ('32bit', 'WindowsPE')
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\calibre\gui2\widgets.py", line 146, in do_test
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

Changed in calibre:
status: New → Fix Released
To post a comment you must log in.
This report contains Public information  Edit
Everyone can see this information.

Other bug subscribers