mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04: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
@ -13,6 +13,7 @@ from calibre.gui2 import choose_dir, error_dialog, warning_dialog
|
||||
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 @@ class GenerateCatalogAction(InterfaceAction):
|
||||
_('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…
x
Reference in New Issue
Block a user