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 python regex test scripts #64

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

marler8997
Copy link

@marler8997 marler8997 commented Mar 7, 2021

Unlike a BASH shell command, in python, when you pass an array of strings to call, the arguments are not to be quoted unless the intention is to pass the quotes to the underlying command. In this case the the underlying programs "test_rand.c" and "test_rand_neg.c" which are not expecting their arguments to be quoted, but instead, are expecting them to be unquoted regular expression strings. This is a common mistake because BASH requires quotes to disable special character but Python does no escaping, it just passes the string unmodified to the new subprocess.

In python, when you pass an array to "call", the arguments are not to be quoted unless you are intending on passing the quotes to the underlying command you are running.  In this case the the underlying programs test_rand.c and test_rand_neg.c are not expecting their arguments to be quoted, but instead, are expecting them to be unquoted regular expression strings.  This is a common mistake because people confuse the BASH syntax for escaping characters with the strings passed to a subprocess in Python.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant