mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-05-08 17:24:20 +02:00
Catalog generation: Do not error out when generating csv/xml catalogs if the catalog title contains filename invalid characters. Fixes #960154 (Error on Generate Catalog)
This commit is contained in:
parent
88ade6c371
commit
08da7ad9ab
1 changed files with 3 additions and 1 deletions
|
|
@ -13,6 +13,7 @@
|
|||
from calibre.gui2.tools import generate_catalog
|
||||
from calibre.utils.config import dynamic
|
||||
from calibre.gui2.actions import InterfaceAction
|
||||
from calibre import sanitize_file_name_unicode
|
||||
|
||||
class GenerateCatalogAction(InterfaceAction):
|
||||
|
||||
|
|
@ -89,7 +90,8 @@ def catalog_generated(self, job):
|
|||
_('Select destination for %(title)s.%(fmt)s') % dict(
|
||||
title=job.catalog_title, fmt=job.fmt.lower()))
|
||||
if export_dir:
|
||||
destination = os.path.join(export_dir, '%s.%s' % (job.catalog_title, job.fmt.lower()))
|
||||
destination = os.path.join(export_dir, '%s.%s' % (
|
||||
sanitize_file_name_unicode(job.catalog_title), job.fmt.lower()))
|
||||
shutil.copyfile(job.catalog_file_path, destination)
|
||||
|
||||
|
||||
|
|
|
|||
Loading…
Reference in a new issue