From 0163b537dcfd7ee92c60b6d9b931a233d670e3b2 Mon Sep 17 00:00:00 2001 From: Eli Schwartz Date: Fri, 8 Nov 2019 14:10:34 -0500 Subject: [PATCH] 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 --- setup/linux-installer.py | 2 +- setup/linux-installer.sh | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/setup/linux-installer.py b/setup/linux-installer.py index 0f5085e431..6214278372 100644 --- a/setup/linux-installer.py +++ b/setup/linux-installer.py @@ -163,7 +163,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) diff --git a/setup/linux-installer.sh b/setup/linux-installer.sh index 53033bd08b..5fb4910843 100644 --- a/setup/linux-installer.sh +++ b/setup/linux-installer.sh @@ -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)