Ticket #4496 (closed defect: fixed)
Crash on adding several books to library
| Reported by: | grolm | Owned by: | norguhtar@… |
|---|---|---|---|
| Priority: | major | Milestone: | |
| Component: | FB2 Input | Version: | trunk |
| Keywords: | Cc: |
Description
I am adding a lot of files from lib.rus.ec archive in fb2 format. I do not need so much files but they are named as 1.fb2, 2.fb2, 3.fb2... Thus I add all files to find what I need. I use calibredb as
calibredb add -r /path/to/files
The following exception occurs:
Traceback (most recent call last):
File "/usr/bin/calibredb", line 16, in <module>
sys.exit(main())
File "/usr/lib/calibre/calibre/library/cli.py", line 617, in main
return command(args[2:], dbpath)
File "/usr/lib/calibre/calibre/library/cli.py", line 356, in command_add
do_add(get_db(dbpath, opts), args[1:], opts.one_book_per_directory, opts.recurse, opts.duplicates)
File "/usr/lib/calibre/calibre/library/cli.py", line 293, in do_add
dir_dups.extend(db.recursive_import(dir, single_book_per_directory=one_book_per_directory))
File "/usr/lib/calibre/calibre/library/database2.py", line 1689, in recursive_import
self.import_book_directory_multiple(dirpath[0], callback=callback)
File "/usr/lib/calibre/calibre/library/database2.py", line 1662, in import_book_directory_multiple
self.import_book(mi, formats)
File "/usr/lib/calibre/calibre/library/database2.py", line 1441, in import_book
self.set_metadata(id, mi)
File "/usr/lib/calibre/calibre/library/database2.py", line 1085, in set_metadata
self.set_series_index(id, mi.series_index, notify=False)
File "/usr/lib/calibre/calibre/library/database2.py", line 1285, in set_series_index
idx = float(idx)
ValueError: invalid literal for float(): 1994 01
As a result not all files added to database. Ubuntu 9.10. Calibre 0.6.13+dfsg-0ubuntu3.1
I propose the following solution: to add appropriate try/catch to decrease severity of such errors like this produced by malformed/unexpected metadata value.
Change History
Note: See
TracTickets for help on using
tickets.
