Skip to content

Commit 634f2b3

Browse files
authored
fix(core): CWL to work with filenames with spaces (#2187)
fix #2182
1 parent 221aeba commit 634f2b3

File tree

2 files changed

+24
-1
lines changed

2 files changed

+24
-1
lines changed

renku/core/commands/cwl_runner.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -56,7 +56,7 @@ def addLocation(d):
5656
runtime_context = RuntimeContext(
5757
kwargs={"rm_tmpdir": False, "move_outputs": "leave", "preserve_entire_environment": True}
5858
)
59-
loading_context = LoadingContext(kwargs={"construct_tool_object": construct_tool_object})
59+
loading_context = LoadingContext(kwargs={"construct_tool_object": construct_tool_object, "relax_path_checks": True})
6060

6161
factory = cwltool.factory.Factory(loading_context=loading_context, runtime_context=runtime_context)
6262
process = factory.make(os.path.relpath(str(output_file)))

tests/cli/test_rerun.py

Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -116,6 +116,29 @@ def test_rerun_with_inputs(runner, project, run):
116116
assert f.read() != initial_data, "The output should have changed."
117117

118118

119+
def test_rerun_with_inputs_with_spaces(runner, project, run):
120+
"""Test file recreation with specified inputs."""
121+
cwd = Path(project)
122+
input_ = cwd / "foo bar.txt"
123+
124+
output = cwd / "output.txt"
125+
126+
cmd = ["run", "python", "-S", "-c", "import random; print(random.random())"]
127+
128+
assert 0 == run(args=cmd, stdout=input_), "Random number generation."
129+
130+
cmd = ["run", "cat"] + [str(input_)]
131+
assert 0 == run(args=cmd, stdout=output)
132+
133+
with output.open("r") as f:
134+
initial_data = f.read()
135+
136+
assert 0 == run(args=("rerun", str(output)))
137+
138+
with output.open("r") as f:
139+
assert f.read() != initial_data, "The output should have changed."
140+
141+
119142
def test_rerun_with_inputs_with_from(runner, project, run):
120143
"""Test file recreation with specified inputs."""
121144
cwd = Path(project)

0 commit comments

Comments
 (0)