Closed alexander-novo closed 1 year ago
Click doesn't do anything that would affect the value as you've shown. What does sys.argv
contain? This is likely some weird shell quoting behavior in PowerShell.
Oh you're right, I just checked and that is being added. How bizarre. Sorry for the erroneous report.
EDIT: I did some investigating and this was a powershell bug fixed a long time ago, but in a much later version than what is currently distributed with Windows.
Environment:
Example code (found in NVlabs/stylegan3 and trimmed):
This happens even if the above
type
is left as default (string). When a path without a space is given assource
, the program works as expected:But if a path with a space is given (either by escaping or quoting, as done above with the non-space directory), the
source
argument has an erroneous quotation mark at the end:As mentioned above, changing the
type
of theoption
gives a similar issue, but won't error the program and quit:Actually, after re-analyzing the example results I gave here, I realised that not only does it append a quotation mark, it also removes the trailing backslash (note how in the first working example, the trailing backslash is still present). After re-trying the results with removing the trailing backslash from the input argument, the problem no longer occurred:
So an additional stipulation is that the argument must have a trailing backslash I suppose?