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

Re: [HTCondor-users] Environment variables parsing in Python Bindings

Hi Brian,

Thanks for your reply!

I submitted several test jobs via condor_submit, it seems some env-variables with sepecial charactors are also filtered out.  

Not sure what's the filter condition in condor_submit, but I'll also filter out the special variables via python bindings.



åää:"Bockelman, Brian" <BBockelman@xxxxxxxxxxxxx>
åéæé:2019-05-29 22:41:29 (ææä)
æää: "HTCondor-Users Mail List" <htcondor-users@xxxxxxxxxxx>
äé: Re: [HTCondor-users] Environment variables parsing in Python Bindings

Hi Xiaowei,

This came up during HTCondor week in other contexts.

For the environment variables, command line arguments, and file names (as in transfer_input_files), there is no generic mechanism that can handle all special characters (I think the newline in your environment variable is causing you problems).

This likely will need to be addressed in a future HTCondor version.

That said, based on your code below, you might be able to accomplish something similar by setting

cmd_dict["getenv"] = "True"


On May 27, 2019, at 10:02 PM, JIANG Xiaowei <jiangxw@xxxxxxxxxx> wrote:

Hello All,

We met a problem about using Python Bindings to submit jobs. 

Some environment variables with special format can not be parsed normally.

Here is what we're doing on parsing environment variables:

    environment = ""
    for key in os.environ.keys():
        if "BASH_FUNC_module" in key or "TERMCAP" in key :
        environment = environment+" "+key+"="+os.environ[key].replace(' ','\' \'')

    cmd_dict["Environment"] = environment

The variable "BASH_FUNC_module" is:

BASH_FUNC_module()=() {  eval `/usr/bin/modulecmd bash $*`

This variable caused parsing error, we have to filter it out.

Does anyone know how we can deal with this format of variables?

Looking forward any help, thanks in advance!



HTCondor-users mailing list
To unsubscribe, send a message to htcondor-users-request@xxxxxxxxxxx with a
subject: Unsubscribe
You can also unsubscribe by visiting

The archives can be found at: