Catalog generation fails

Bug #1048404 reported by Dan Clough
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
calibre
Fix Released
Undecided
Unassigned

Bug Description

When trying to generate a catalog in MOBI or EPUB format, I get the following error and failure. It does work properly for CSV format. Running Calibre 0.8.68 on Linux. I have attached my 'metadata.db' file as requested in the forum. Thanks.

calibre, version 0.8.68 (linux2, isfrozen: True)
Conversion Error: Failed: Generate catalog

Generate catalog
 Sections: Authors, Titles
Catalog_EPUB_MOBI(): Generating mobi for kindle in GUI environment
 connected_device: 'None'
 book count: 969
 opts:
  author_clip: 60
  catalog_title: u'My Books'
  connected_kindle: False
  description_clip: 100
  exclude_genre: u'.'
  exclusion_rules: ()
  fmt: u'mobi'
  header_note_source_field: ''
  merge_comments_rule: '::True'
  output_profile: 'kindle'
  prefix_rules: ()
  search_text: None
  sort_by: None
  sort_descriptions_by_author: True
  sync: False
  thumb_width: u'1.00'
  use_existing_cover: False
 Thumbnails:
  DPI = 168; thumbnail dimensions: 84 x 112
 Begin catalog source generation
 unhandled exception in catalog generator
Traceback (most recent call last):
  File "site.py", line 58, in main
  File "site-packages/calibre/utils/ipc/worker.py", line 186, in main
  File "site-packages/calibre/gui2/convert/gui_conversion.py", line 68, in gui_catalog
  File "site-packages/calibre/library/catalogs/epub_mobi.py", line 337, in run
  File "site-packages/calibre/library/catalogs/epub_mobi_builder.py", line 367, in build_sources
  File "site-packages/calibre/library/catalogs/epub_mobi_builder.py", line 794, in fetch_books_by_author
  File "site-packages/calibre/library/catalogs/epub_mobi_builder.py", line 794, in <lambda>
  File "site-packages/calibre/library/catalogs/epub_mobi_builder.py", line 334, in _kf_books_by_author_sorter_author_sort
UnicodeEncodeError: 'latin-1' codec can't encode character u'\u2019' in position 6: ordinal not in range(256)

Related branches

Revision history for this message
Dan Clough (danc3) wrote :
Changed in calibre:
assignee: nobody → GRiker (griker)
Revision history for this message
GRiker (griker-deactivatedaccount) wrote :

First, you can delete your metadata.db attachment, as I've download it.

When I build a catalog it's not failing for me. What computer/OS are you using?

Revision history for this message
Dan Clough (danc3) wrote : Re: [Bug 1048404] Re: Catalog generation fails

I'm using a Lenovo laptop (i7 cpu) and Slackware Linux OS (ver 13.37
32-bit).

Perhaps it's something to do with the Python version I have... Slackware
is about to release a new version and I can try it again on that, soon...

Thanks.

On 09/09/2012 05:48 PM, GRiker wrote:
> First, you can delete your metadata.db attachment, as I've download it.
>
> When I build a catalog it's not failing for me. What computer/OS are you
> using?
>

Revision history for this message
GRiker (griker-deactivatedaccount) wrote :

Don't delete the metadata file. I don't have a Linux box, so I will ask Kovid to see if he can replicate the bug on his system.

Revision history for this message
Kovid Goyal (kovid) wrote :

@GRiker: This is caused by various implicit bytestring to unicode conversions in the catalog code. I've fixed a few of them. The errors dont show up on os x because the default encoding there is UTF-8. Some (usually older) linux installs still set their encoding to non utf-8 values.

@Dan: Change your system locale to a UTF-8 based one and the error will go away.

Revision history for this message
Kovid Goyal (kovid) wrote : Fixed in lp:calibre

Fixed in branch lp:calibre. The fix will be in the next release. calibre is usually released every Friday.

 status fixreleased

Changed in calibre:
status: New → Fix Released
Revision history for this message
Dan Clough (danc3) wrote :

Kovid and GRiker,

It worked! Changed my system locale to en_US.utf8 and now can generate a MOBI catalog just fine.

THANK YOU VERY MUCH!!! Really appreciate the prompt and effective help.

Best regards,
Dan

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.