Skip to content

Commit

Permalink
Special chars creating submit issues
Browse files Browse the repository at this point in the history
 issue was stemming from local.py, the var called cmd
cmd = f'cd {path}; {submit_cmd} {submit_filename}'

here we defined path but never put it in quotations so special chars like `[` and `]` would be misinterpreted by the shell

so in python would change to the direct of /rxn_120_CCN/ instead of /rxn_120_[CH2]CN/ (assuming out intention was to go to  /rxn_120_[CH2]CN/)

so just needed to change it to

cmd = f'cd "{path}"; {submit_cmd} {submit_filename}'
  • Loading branch information
calvinp0 committed Dec 14, 2023
1 parent 431854b commit 9a88498
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions arc/job/local.py
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,7 @@ def submit_job(path: str,
job_status, job_id = '', ''
submit_cmd = submit_cmd or submit_command[cluster_soft]
submit_filename = submit_filename or submit_filenames[cluster_soft]
cmd = f"cd {path}; {submit_cmd} {submit_filename}"
cmd = f'cd "{path}"; {submit_cmd} {submit_filename}'

Check warning on line 244 in arc/job/local.py

View check run for this annotation

Codecov / codecov/patch

arc/job/local.py#L244

Added line #L244 was not covered by tests
stdout, stderr = execute_command(cmd)
if not len(stdout):
time.sleep(10)
Expand Down Expand Up @@ -390,7 +390,7 @@ def change_mode(mode: str,
if os.path.isfile(path):
path = os.path.dirname(path)
recursive = ' -R' if recursive else ''
command = [f'cd {path}'] if path else []
command = [f'cd "{path}"'] if path else []
command.append(f'chmod{recursive} {mode} {file_name}')
execute_command(command=command)

Expand Down

0 comments on commit 9a88498

Please sign in to comment.