diff --git a/libsubmit/channels/local/local.py b/libsubmit/channels/local/local.py index 81b7d62..98e517f 100644 --- a/libsubmit/channels/local/local.py +++ b/libsubmit/channels/local/local.py @@ -145,7 +145,7 @@ def push_file(self, source, dest_dir): - FileCopyException : If file copy failed. ''' - local_dest = dest_dir + '/' + os.path.basename(source) + local_dest = os.path.join(dest_dir, os.path.basename(source)) # Only attempt to copy if the target dir and source dir are different if os.path.dirname(source) != dest_dir: diff --git a/libsubmit/channels/ssh/ssh.py b/libsubmit/channels/ssh/ssh.py index 12dfe35..5622206 100644 --- a/libsubmit/channels/ssh/ssh.py +++ b/libsubmit/channels/ssh/ssh.py @@ -202,7 +202,7 @@ def pull_file(self, remote_source, local_dir): - FileCopyException : FileCopy failed. ''' - local_dest = local_dir + '/' + os.path.basename(remote_source) + local_dest = os.path.join(local_dir, os.path.basename(remote_source)) try: os.makedirs(local_dir) diff --git a/libsubmit/providers/cluster_provider.py b/libsubmit/providers/cluster_provider.py index 24521ce..820fb65 100644 --- a/libsubmit/providers/cluster_provider.py +++ b/libsubmit/providers/cluster_provider.py @@ -113,8 +113,9 @@ def _write_submit_script(self, template, script_filename, job_name, configs): try: submit_script = Template(template).substitute(jobname=job_name, **configs) + submit_script = submit_script.replace("\r\n", "\n") # submit_script = Template(template).safe_substitute(jobname=job_name, **configs) - with open(script_filename, 'w') as f: + with open(script_filename, 'wb') as f: f.write(submit_script) except KeyError as e: