From 01ce541cb42c1c034d792ffe8d48c3a50242a47f Mon Sep 17 00:00:00 2001 From: David Barnett Date: Mon, 20 Jan 2020 21:01:06 -0800 Subject: [PATCH] Fix weirdly duplicated system hijack output on python 3.7 An intentional behavior change in python re.sub added a second empty match and "substitution" for '.*' (https://bugs.python.org/issue32308). This changed the catch-all regex vroom was using to an anchored '^.*$', which will ensure it only makes one substitution. Fixes #110. --- vroom/shell.py | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/vroom/shell.py b/vroom/shell.py index 19e2b14..7ea1f9c 100644 --- a/vroom/shell.py +++ b/vroom/shell.py @@ -202,7 +202,7 @@ def Response(self, command): except re.error as e: raise vroom.ParseError("Can't match command. Invalid regex. %s'" % e) else: - match_regex = re.compile(r'.*') + match_regex = re.compile(r'^.*$') # The actual response won't be exactly like the internal response, because # we've got to do some regex group binding magic.