diff --git a/src/calibre/ebooks/metadata/sources/amazon.py b/src/calibre/ebooks/metadata/sources/amazon.py index d2573c500b..110b0774c9 100644 --- a/src/calibre/ebooks/metadata/sources/amazon.py +++ b/src/calibre/ebooks/metadata/sources/amazon.py @@ -1410,7 +1410,7 @@ if __name__ == '__main__': # tests {{{ ] # }}} ca_tests = [ # {{{ - ( # Paperback with series + ( # Paperback with series {'identifiers':{'isbn':'9781623808747'}}, [title_test('Parting Shot', exact=True), authors_test(['Mary Calmes'])] ), @@ -1434,8 +1434,7 @@ if __name__ == '__main__': # tests {{{ test_identify_plugin(Amazon.name, tests, modify_plugin=lambda p:(setattr(p, 'testing_domain', domain), setattr(p, 'touched_fields', p.touched_fields - {'tags'}))) - #do_test('com') - do_test('ca') + do_test('com') # do_test('de') # }}} diff --git a/src/calibre/ebooks/oeb/polish/parsing.py b/src/calibre/ebooks/oeb/polish/parsing.py index 3c6dce466d..790f3ac059 100644 --- a/src/calibre/ebooks/oeb/polish/parsing.py +++ b/src/calibre/ebooks/oeb/polish/parsing.py @@ -541,6 +541,8 @@ class NoNamespaceTreeBuilder(TreeBuilder): body.set(to_xml_name(k), v) # Input Stream {{{ + + _regex_cache = {} @@ -604,6 +606,7 @@ class FastStream(object): return (lnum + 1, offset) # }}} + if len("\U0010FFFF") == 1: # UCS4 build replace_chars = re.compile("[\uD800-\uDFFF]") else: @@ -689,9 +692,9 @@ def parse(raw, decoder=None, log=None, line_numbers=True, linenumber_attribute=N log.exception('Failed to parse as XML, parsing as tag soup') return parse_html5(raw, log=log, line_numbers=line_numbers, linenumber_attribute=linenumber_attribute, replace_entities=False, fix_newlines=False) + if __name__ == '__main__': from lxml import etree root = parse_html5('\n
\nb