File: 0071-Revert-always-use-raw-string-for-regex-manual.patch

package info (click to toggle)
calibre 8.10.0%2Bds-3
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid
  • size: 433,488 kB
  • sloc: python: 452,092; ansic: 87,292; javascript: 57,711; cpp: 19,179; xml: 1,247; sh: 939; sql: 735; objc: 330; makefile: 68; sed: 3
file content (35 lines) | stat: -rw-r--r-- 1,547 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
From: YOKOTA Hiroshi <yokota.hgml@gmail.com>
Date: Fri, 24 Jan 2025 11:14:20 +0100
Subject: Revert "always use raw-string for regex (manual)"

Forwarded: not-needed

This reverts commit 3720de10d2ab7d0e647335fa148b96bd3bd5bdc0.
---
 src/calibre/ebooks/unihandecode/jadecoder.py  | 2 +-
 src/calibre/ebooks/unihandecode/unidecoder.py | 2 +-
 2 files changed, 2 insertions(+), 2 deletions(-)

diff --git a/src/calibre/ebooks/unihandecode/jadecoder.py b/src/calibre/ebooks/unihandecode/jadecoder.py
index 16a31fc..64e8445 100644
--- a/src/calibre/ebooks/unihandecode/jadecoder.py
+++ b/src/calibre/ebooks/unihandecode/jadecoder.py
@@ -90,4 +90,4 @@ class Jadecoder(Unidecoder):
                 text = self.conv.do(text)
         except Exception:
             pass
-        return re.sub(r'[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
+        return re.sub('[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
diff --git a/src/calibre/ebooks/unihandecode/unidecoder.py b/src/calibre/ebooks/unihandecode/unidecoder.py
index 5b4f2c1..a6b52f7 100644
--- a/src/calibre/ebooks/unihandecode/unidecoder.py
+++ b/src/calibre/ebooks/unihandecode/unidecoder.py
@@ -73,7 +73,7 @@ class Unidecoder:
 
     def decode(self, text):
         # Replace characters larger than 127 with their ASCII equivalent.
-        return re.sub(r'[^\x00-\x7f]', lambda x: self.replace_point(x.group()), text)
+        return re.sub('[^\x00-\x7f]',lambda x: self.replace_point(x.group()), text)
 
     def replace_point(self, codepoint):
         '''