Test: Error when queryval contains spaces
On main when using spaces in queryval you get an error. Running one of the examples from the website
make print-test query='args' queryval='pc_type ml'
Yields on my machine
File "/Users/aidan/Packages/petsc//config/query_tests.py", line 419, in <module>
main()
File "/Users/aidan/Packages/petsc//config/query_tests.py", line 369, in main
match=alternate_command_preprocess(shell_unquote(args[1]))
^^^^^^^^^^^^^^^^^^^^^^
File "/Users/aidan/Packages/petsc//config/query_tests.py", line 357, in shell_unquote
assert len(ret) == 1, "Dont know what to do if shlex.split() produces more than 1 value?"
^^^^^^^^^^^^^
AssertionError: Dont know what to do if shlex.split() produces more than 1 value?
A quick fix that seems to work is to change
shell_unquote(string):
from
import shlex
if string:
ret = shlex.split(string)
assert len(ret) == 1, "Dont know what to do if shlex.split() produces more than 1 value?"
string = ret[0]
return string
to
import shlex
if string:
ret = shlex.split(string)
string = " ".join(ret)
return string
However I'm not sure if that breaks something elsewhere.