https://pantsbuild.org/ logo
h

helpful-lunch-92084

03/08/2021, 5:11 PM
just ran into this on 2.2, we were trying to do a
pants run path/to/binary -- binary’s arguments
. Now the binary’s arguments happened to have brackets
[]
in them and pants was aborting with:
Copy code
File "/Users/nate/.cache/pants/setup/bootstrap-Darwin-x86_64/2.2.0_py38/lib/python3.8/site-packages/pants/util/eval.py", line 47, in parse_expression
    raise raise_type(
pants.option.errors.ParseError: The value cannot be evaluated as a literal expression: SyntaxError('unexpected EOF while parsing', ('<string>', 1, 8, '[test] quoting'))
Given raw value:
1: [test] quoting
In v1 we made heavy use of pants run with
--
expecting pants to stop processing argv after that. I tried looking at
--run-args
but it seems that the brackets still cause it to bail.
e

enough-analyst-54434

03/08/2021, 5:14 PM
That sounds like a good straight up bug. Do you mind filing an issue?
h

helpful-lunch-92084

03/08/2021, 5:14 PM
will do
h

happy-kitchen-89482

03/08/2021, 5:31 PM
Thanks for reporting. I followed up on the ticket.
h

helpful-lunch-92084

03/08/2021, 5:38 PM
yah i’ll try to come up with a more complete example
e

enough-analyst-54434

03/08/2021, 5:55 PM
Gotcha there Nate, the Pants repo itself had a good example.
Benjy has a workaround on the ticket, but it's a regression from Pants v1.x and probably not what the status quo should be.
h

helpful-lunch-92084

03/08/2021, 5:57 PM
yah i replied because i think the workaround only works if the brackets aren’t the start of argv
i posted that on the ticket
for now we’ve just backslash escaped our brackets with a simple regex so we can wait
h

happy-kitchen-89482

03/08/2021, 9:04 PM
Sorry for the trouble, and thanks for the bug report! We'll get a fix out soon
💯 1
w

witty-crayon-22786

03/10/2021, 4:58 AM
metal 1
4 Views