From 07b4563c36e7ddd589ace467074921ed1a6fc155 Mon Sep 17 00:00:00 2001 From: Kovid Goyal Date: Fri, 17 Dec 2021 17:13:25 +0530 Subject: [PATCH] py3compat: Another PDB ereader output fix --- src/calibre/ebooks/pdb/ereader/writer.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/calibre/ebooks/pdb/ereader/writer.py b/src/calibre/ebooks/pdb/ereader/writer.py index 2f13147180..03f6551d58 100644 --- a/src/calibre/ebooks/pdb/ereader/writer.py +++ b/src/calibre/ebooks/pdb/ereader/writer.py @@ -108,9 +108,9 @@ class Writer(FormatWriter): item += struct.pack('>L', mo.start()) text = mo.group('text') # Strip all PML tags from text - text = re.sub(br'\\U[0-9a-z]{4}', '', text) - text = re.sub(br'\\a\d{3}', '', text) - text = re.sub(br'\\.', '', text) + text = re.sub(br'\\U[0-9a-z]{4}', b'', text) + text = re.sub(br'\\a\d{3}', b'', text) + text = re.sub(br'\\.', b'', text) # Add appropriate spacing to denote the various levels of headings if 'val' in mo.groupdict().keys(): text = b'%s%s' % (b' ' * 4 * int(mo.group('val')), text)