[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: [HTCondor-users] passing in args with spaces



On Wed, Jan 3, 2018 at 5:58 AM, Todd Tannenbaum <tannenba@xxxxxxxxxxx> wrote:
>
>
> On Jan 2, 2018, at 6:23 PM, Larry Martell <larry.martell@xxxxxxxxx> wrote:
>
> I am using htcondor.Submit() and trying to pass in an argument with a
> space in it. The argument key in my submit dict has this:
>
> "--arg_with_space 'word1 word2'"
>
> and in the StarterLog I see:
>
> --arg_with_space ''''word1 word2''''
>
>
> I am following what I read here:
> http://research.cs.wisc.edu/htcondor/manual/current/condor_submit.html.
>
>
> Yep, that is where you want to look.
>
> Looks to me like you are having problems with Pythonâs rules for escaping
> string literals. See
> https://docs.python.org/2.0/ref/strings.html
>
> I have also tried it without single quotes and with double quotes,
> both escapes with backslashes and not escaped, none of which worked.
>
>
> Could you send us the properly Python escaped dictionary key you tried? Iâd
> expect the following would work (didnât test it however):
>
> âââ"--arg_with_space 'word1 word2'"âââ
>
> Ie surround the string you posted above with three single quote mark
> (so-called triple quoting in python).

Thanks so much. Triple quoting worked.

> I also suggest testing you job submit description first with the
> condor_submit command line tool, and if all is good then proceed to convert
> to Python via the htcondor.Submit() class. This way you can identify if the
> problem is in your HTCondor job submit description or Python-specific.
>
>
> What is the proper way to pass in an argument with a space in it?