From 42543e57ec054f7ed9683fdea78e867c079695ac Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Sat, 8 Jul 2017 08:59:34 +0530 Subject: [PATCH] Fix #1702914 [error trying to create .bib catalog](https://bugs.launchpad.net/calibre/+bug/1702914) --- src/calibre/utils/bibtex.py | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/src/calibre/utils/bibtex.py b/src/calibre/utils/bibtex.py index 695eac0df4..09e16ddf67 100644 --- a/src/calibre/utils/bibtex.py +++ b/src/calibre/utils/bibtex.py @@ -65,7 +65,6 @@ __docformat__ = 'restructuredtext en' import re, string -from calibre.constants import preferred_encoding from calibre.utils.mreplace import MReplace utf8enc2latex_mapping = { @@ -2855,7 +2854,7 @@ class BibTeX: # http://bibdesk.sourceforge.net/manual/BibDesk%20Help_2.html self.invalid_cit = re.compile(u'[ "@\',\\#}{~%&$^]') self.upper = re.compile(u'[' + - string.uppercase.decode(preferred_encoding) + u']') + string.ascii_uppercase + u']') self.escape = re.compile(u'[~#&%_]') def ValidateCitationKey(self, text): @@ -2929,4 +2928,3 @@ class BibTeX: text.pop(i) text = ''.join(text) return text -