Skip to content

Commit

Permalink
Fix weirdly duplicated system hijack output on python 3.7
Browse files Browse the repository at this point in the history
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.
  • Loading branch information
dbarnett committed Jan 21, 2020
1 parent 379eefc commit 01ce541
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion vroom/shell.py
Original file line number Diff line number Diff line change
Expand Up @@ -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.
Expand Down

0 comments on commit 01ce541

Please sign in to comment.