mirror of
https://github.com/kovidgoyal/calibre.git
synced 2025-07-09 03:04:10 -04:00
Fix #1693496 [UnicodeDecodeError - cant' change title of a PDF file](https://bugs.launchpad.net/calibre/+bug/1693496)
This commit is contained in:
parent
4e46901cb3
commit
4a0db45362
@ -12,7 +12,7 @@ from itertools import groupby
|
||||
from PyQt5.Qt import (QAbstractTableModel, Qt, pyqtSignal, QIcon, QImage,
|
||||
QModelIndex, QDateTime, QColor, QPixmap, QPainter, QApplication)
|
||||
|
||||
from calibre import fit_image
|
||||
from calibre import fit_image, force_unicode
|
||||
from calibre.gui2 import error_dialog
|
||||
from calibre.utils.search_query_parser import ParseException
|
||||
from calibre.ebooks.metadata import fmt_sidx, authors_to_string, string_to_authors
|
||||
@ -1094,11 +1094,11 @@ class BooksModel(QAbstractTableModel): # {{{
|
||||
import traceback
|
||||
if getattr(err, 'errno', None) == errno.EACCES: # Permission denied
|
||||
fname = getattr(err, 'filename', None)
|
||||
p = 'Locked file: %s\n\n'%fname if fname else ''
|
||||
p = 'Locked file: %s\n\n'%force_unicode(fname if fname else '')
|
||||
error_dialog(get_gui(), _('Permission denied'),
|
||||
_('Could not change the on disk location of this'
|
||||
' book. Is it open in another program?'),
|
||||
det_msg=p+traceback.format_exc(), show=True)
|
||||
det_msg=p+force_unicode(traceback.format_exc()), show=True)
|
||||
return False
|
||||
error_dialog(get_gui(), _('Failed to set data'),
|
||||
_('Could not set data, click Show Details to see why.'),
|
||||
|
Loading…
x
Reference in New Issue
Block a user