def METHOD_NAME(path):
    # get the bash command
    bash_cmd = self._bash_cmd()
    # build commands to setup the environment
    setup_cmds = self._build_setup_cmds(self._get_env())
    # build the python command that dumps the environment
    py_cmd = "import os,pickle;" \
        + "pickle.dump(dict(os.environ),open('{}','wb'),protocol=2)".format(path)
    # build the full command
    cmd = quote_cmd(bash_cmd + ["-c", " && ".join(flatten(
        "source \"{}\" \"\"".format(self.script),
        setup_cmds,
        quote_cmd(["python", "-c", py_cmd]),
    ))])
    # run it
    returncode = interruptable_popen(cmd, shell=True, executable="/bin/bash")[0]
    if returncode != 0:
        raise Exception("bash sandbox env loading failed with exit code {}".format(
            returncode))