Fix #3555 (UnicodeDecodeError: ... unexpected code byte in Russian fb2)

This commit is contained in:
Kovid Goyal 2009-09-22 13:47:14 -06:00
parent 74db760282
commit be0a623e65
2 changed files with 2 additions and 2 deletions

View File

@ -45,7 +45,7 @@ class FB2Input(InputFormatPlugin):
log.debug('Parsing XML...') log.debug('Parsing XML...')
parser = etree.XMLParser(recover=True, no_network=True) parser = etree.XMLParser(recover=True, no_network=True)
doc = etree.parse(stream, parser) doc = etree.fromstring(stream.read())
self.extract_embedded_content(doc) self.extract_embedded_content(doc)
log.debug('Converting XML to HTML...') log.debug('Converting XML to HTML...')
ss = open(P('templates/fb2.xsl'), 'rb').read() ss = open(P('templates/fb2.xsl'), 'rb').read()

View File

@ -130,7 +130,7 @@ def metadata_from_filename(name, pat=None):
au = match.group('author') au = match.group('author')
aus = string_to_authors(au) aus = string_to_authors(au)
mi.authors = aus mi.authors = aus
except IndexError: except (IndexError, ValueError):
pass pass
try: try:
mi.series = match.group('series') mi.series = match.group('series')