diff --git a/src/calibre/ebooks/metadata/sources/identify.py b/src/calibre/ebooks/metadata/sources/identify.py index 1bd071d6f9..31998dfcb2 100644 --- a/src/calibre/ebooks/metadata/sources/identify.py +++ b/src/calibre/ebooks/metadata/sources/identify.py @@ -403,7 +403,7 @@ def identify(log, abort, # {{{ result.identify_plugin = plugin if msprefs['txt_comments']: if plugin.has_html_comments and result.comments: - result.comments = html2text(r.comments) + result.comments = html2text(result.comments) log('The identify phase took %.2f seconds'%(time.time() - start_time)) log('The longest time (%f) was taken by:'%longest, lp) diff --git a/src/calibre/gui2/metadata/basic_widgets.py b/src/calibre/gui2/metadata/basic_widgets.py index b2c5d471ae..8858f9c986 100644 --- a/src/calibre/gui2/metadata/basic_widgets.py +++ b/src/calibre/gui2/metadata/basic_widgets.py @@ -1038,10 +1038,11 @@ class IdentifiersEdit(QLineEdit): # {{{ self.setStyleSheet('QLineEdit { background-color: %s }'%col) def paste_isbn(self): - cb = QApplication.clipboard() - vals = self.current_val - vals['isbn'] = cb.text() - self.current_val = vals + text = unicode(QApplication.clipboard().text()).strip() + if text: + vals = self.current_val + vals['isbn'] = text + self.current_val = vals # }}}