pyblish / pyblish-base

Pyblish base library - see https://github.com/pyblish/pyblish for details.
Other
123 stars 60 forks source link

convert tuple ctx.obj["plugin_paths"] to list before concatenation #357

Closed iLLiCiTiT closed 4 years ago

iLLiCiTiT commented 4 years ago
tokejepsen commented 4 years ago

When does this return a tuple?

Maybe we can get a test for this, to cement it for the future?

iLLiCiTiT commented 4 years ago

We actually didn't found out when/why it happens. Seems like it happens when pyblish is launched with cli in python 3 (but not sure). We're using these args: -pp {paths_to_plugins} and -d {data_info}

EDITED: and --publish-gui argument

iLLiCiTiT commented 4 years ago

Is possible to merge this?

davidlatwe commented 4 years ago

It seems that module click which responsible to parsing args was meant to parse multiple options as tuple, see here.

In doc it says Multiple Options is similarly to nargs, which configures Multi Value Options, and it stores values as a tuple.

Look at the code in .vendor.click.core in this line, if you replace tuple with list, the error we has encountered is gone.

mottosso commented 4 years ago

There we go. Once someone can confirm this solves the issue this is ready to merge. Now values are list regardless of whether they come from Pyblish or CLI.

iLLiCiTiT commented 4 years ago

I checked and TypeError: can only concatenate tuple (not "list") to tuple did not appear so I assume it works.

davidlatwe commented 4 years ago

Nice ! Can confirm it works !