Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix weirdly duplicated system hijack output on python 3.7 #111

Merged
merged 1 commit into from
Jan 21, 2020
Merged

Conversation

dbarnett
Copy link
Contributor

@dbarnett dbarnett commented Jan 21, 2020

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.

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.
Copy link
Member

@malcolmr malcolmr left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Weird, but thanks for digging up the root cause!

@serhiy-storchaka
Copy link

If a line is always non-empty or if you do not want to replace empty line, you can use .+ instead of ^.*$.

@dbarnett
Copy link
Contributor Author

@serhiy No, the intention for this code is more "replace whatever contents were there", so a more selective pattern like .+ wouldn't be appropriate and could lead to even stranger bugs later.

@dbarnett dbarnett merged commit 86fd37f into master Jan 21, 2020
@dbarnett dbarnett deleted the py37 branch August 2, 2020 03:52
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

System hijacks failing when using python 3.7
4 participants