Open johhnry opened 1 year ago
Hi @johhnry, I think you can just do rez env python -- python test.py -s "test"
and it'll work. When I test locally it works as expected:
[jcmorin@arch01 /tmp]$ rez-env python -- python test.py -s "asd"
['test.py', '-s', 'asd']
Or do you have a specific reason to need the second --
?
Hi @JeanChristopheMorinPerso,
The specific reason to use --
is passing arguments to a Blender python script like I described earlier:
$ rez env blender -- blender -b --python script.py -- -s "test"
Since if I pass them after the --python script.py
, they will be parsed as Blender arguments. (Blender ignore all arguments after the --
so it's convenient to pass them here)
What platform / shell are you using? If i am not mistaken --
is a shell feature. Can you maybe escape it?
I know that we do control --
in Rez. Not sure if it works I cmd though, but I am under the impression it works in PowerShell...
@instinct-vfx I am using Powershell in Windows Terminal but it also does the same behavior in cmd:
# In a Rez resolved shell (cmd)
$ blender -b --python test.py -- -s "test"
['blender', '-b', '--python', 'test.py', '--', '-s', 'test']
# In cmd
$ rez env blender -- blender -b --python test.py -- -s "test"
['blender', '-b', '--python', 'test.py']
Yes, I expect the behavior to be the same. --
is handled by the program, not the OS.
I ran into this with nested rez env
commands, for example
$ rez env python -- rez env python -- python3
..which I would expect to execute the python3
command, however it just runs the second rez env
command without arguments(?)
As I understand, it should function the same as either of these two options:
$ rez env python
> $ rez env python
>> $ python 3
or
$ rez env python -c 'rez env python -c "python3"'
I have run into the same issue and had posted about it on Slack, adding the link here for posterity.
https://academysoftwarefdn.slack.com/archives/C0321B828FM/p1694028568579839
Ran into this issue again today, using the Rez integration in Deadline.
I tried to submit a command line job which ran something like rez env example_pkg -- example
However, the included-by-default Rez event plugin for Deadline essentially does
rez env $packages_from_submission etc -- $user_command
So, with $user_command
is the above example
command, what will be executed is:
rez env $packages_from_submission etc -- rez env example_pkg -- example
which of course triggers this bug (resulting in the task executing an interactive shell and getting stuck forever)
Hi,
I want to pass arguments to a Blender Python script through the command line as described here.
I should be able to do this using Rez:
It works when running it in a new Rez shell but not when running the command directly with double dash.
Environment
To Reproduce
Running the command:
Expected behavior
Should print the following:
Actual behavior
Instead it strips out the arguments after the
--
(double dashes):