Skip to content

Commit b1854ac

Browse files
committed
Changing env variable from unicode to str before sending on Windows only
1 parent 583b87b commit b1854ac

File tree

1 file changed

+4
-4
lines changed

1 file changed

+4
-4
lines changed

cwltool/job.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -283,11 +283,11 @@ def run(self, pull_image=True, rm_container=True,
283283
for key, value in os.environ.items():
284284
if key in vars_to_preserve and key not in env:
285285
# On Windows, subprocess env can't handle unicode.
286-
env[key] = str(value)
287-
env["HOME"] = str(self.outdir)
288-
env["TMPDIR"] = str(self.tmpdir)
286+
env[key] = str(value) if onWindows() else value
287+
env["HOME"] = str(self.outdir) if onWindows() else self.outdir
288+
env["TMPDIR"] = str(self.tmpdir) if onWindows() else self.tmpdir
289289
if "PATH" not in env:
290-
env["PATH"] = str(os.environ["PATH"])
290+
env["PATH"] = str(os.environ["PATH"]) if onWindows() else os.environ["PATH"]
291291

292292
stageFiles(self.pathmapper, ignoreWritable=True, symFunc=True)
293293
if self.generatemapper:

0 commit comments

Comments
 (0)