Tweaks for Author Sort don't process extended ASCII properly
Affects | Status | Importance | Assigned to | Milestone | |
---|---|---|---|---|---|
calibre |
Fix Released
|
Undecided
|
Unassigned |
Bug Description
Ongoing bug for a year or two. Steps:
Access Preference>
Edit "Author_
Apply and exit Prefs.
Restart calibre
Select any book and access "Edit Metadata"
note error:
-------
calibre, version 3.1.1
ERROR: Unhandled exception: <b>UnicodeDecod
calibre 3.1.1 embedded-python: True is64bit: False
Windows-
32bit process running on 64bit windows
('Windows', '10', '10.0.15063')
Python 2.7.12+
Windows: ('10', '10.0.15063', 'SP0', u'Multiprocessor Free')
Interface language: None
Successfully initialized third party plugins: DeDRM (6, 1, 0) && Resize Cover (1, 0, 2) && Generate Cover (1, 5, 21) && DOC Input (1, 0, 1) && KindleUnpack - The Plugin (0, 81, 4) && Modify ePub (1, 3, 13) && Open With (1, 5, 10) && Diaps Editing Toolbag (0, 3, 4) && EpubSplit (2, 2, 0)
Traceback (most recent call last):
File "site-packages\
File "site-packages\
File "site-packages\
UnicodeDecodeError: 'utf8' codec can't decode bytes in position 1-2: invalid continuation byte
----------
Reaccessing the Tweak reveals that calibre has saved the new entry as a string of characters containing 2 backslashes. Apparently it is misencoding the accented character when saved or misreading it later when relaunched.
I'm currently running Win10 64bit, with current updates, and 32bit calibre 3.1.1 and decided to test this old issue, which proved to still be present. I had this same error for months around a year ago (older Win10 and a long series of releases of calibre 2.x) and finally tracked it down to using the proper French spelling in the Tweak. Using a simple "e" without the accent works around the issue. Manually editing the author name and author sort to include the accented e works, though the Tag Browser misfiles the entry when the author name is changed until it is found (filed by first name) and the author sort is fixed, which returns it to its proper location in the Tag Browser.
Actually, since your system appears to be using a non UTF-8 encoding, to
be perfectly safe, write it as
u'p\xe8re'