From 61e828b2c2c6647d92e21973be2eba9ff9f0e8bb Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Thu, 1 Dec 2011 08:33:47 +0530 Subject: [PATCH] Metadata download, do not strip # from titles. Fixes #898310 (Special characters stripped rather than encoded when getting metadata) --- src/calibre/ebooks/metadata/sources/amazon.py | 8 ++++++++ src/calibre/ebooks/metadata/sources/base.py | 2 +- 2 files changed, 9 insertions(+), 1 deletion(-) diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index 52dd109b47..8f663bcf86 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -741,6 +741,14 @@ if __name__ == '__main__': # tests {{{ isbn_test, title_test, authors_test) com_tests = [ # {{{ + ( # # in title + {'title':'Expert C# 2008 Business Objects', + 'authors':['Lhotka']}, + [title_test('Expert C# 2008 Business Objects', exact=True), + authors_test(['Rockford Lhotka']) + ] + ), + ( # Description has links {'identifiers':{'isbn': '9780671578275'}}, [title_test('A Civil Campaign: A Comedy of Biology and Manners', diff --git a/src/calibre/ebooks/metadata/sources/base.py b/src/calibre/ebooks/metadata/sources/base.py index f04291eae9..9ae8902671 100644 --- a/src/calibre/ebooks/metadata/sources/base.py +++ b/src/calibre/ebooks/metadata/sources/base.py @@ -344,7 +344,7 @@ class Source(Plugin): # Remove single quotes not followed by 's' (r"'(?!s)", ''), # Replace other special chars with a space - (r'''[:,;+!@#$%^&*(){}.`~"\s\[\]/]''', ' ') + (r'''[:,;+!@$%^&*(){}.`~"\s\[\]/]''', ' '), ]] for pat, repl in title_patterns: