mirror of
git://github.com/kovidgoyal/calibre.git
synced 2026-01-06 13:24:56 +01:00
linux installer: fix python3 re.sub with mismatched str/bytes
This does not seem to have been a very commonly hit case, since it's been broken for python3 since before 2014, but a user has just hit it for the first time. Fixes #1851873
This commit is contained in:
parent
d47c332723
commit
0163b537dc
2 changed files with 2 additions and 2 deletions
|
|
@ -163,7 +163,7 @@ def _tigetstr(self, cap_name):
|
|||
if isinstance(cap_name, bytes):
|
||||
cap_name = cap_name.decode('utf-8')
|
||||
cap = self._escape_code(curses.tigetstr(cap_name))
|
||||
return re.sub(r'\$<\d+>[/*]?', b'', cap)
|
||||
return re.sub(r'\$<\d+>[/*]?', '', cap)
|
||||
|
||||
def render(self, template):
|
||||
return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
|
||||
|
|
|
|||
|
|
@ -212,7 +212,7 @@ class TerminalController: # {{{
|
|||
if isinstance(cap_name, bytes):
|
||||
cap_name = cap_name.decode('utf-8')
|
||||
cap = self._escape_code(curses.tigetstr(cap_name))
|
||||
return re.sub(r'\$<\d+>[/*]?', b'', cap)
|
||||
return re.sub(r'\$<\d+>[/*]?', '', cap)
|
||||
|
||||
def render(self, template):
|
||||
return re.sub(r'\$\$|\${\w+}', self._render_sub, template)
|
||||
|
|
|
|||
Loading…
Reference in a new issue