Skip to content

Commit 4e87e01

Browse files
committed
Shlex quote
feature: shlex quote asyncio run
1 parent 22a170a commit 4e87e01

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

src/sagemaker_training/process.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -113,7 +113,7 @@ async def run_async(cmd, processes_per_host, env, cwd, stderr, **kwargs):
113113
Raises:
114114
error_class: If there is an exception raised when creating the process.
115115
"""
116-
cmd = " ".join(cmd)
116+
cmd = " ".join(six.moves.shlex_quote(token) for token in cmd)
117117
proc = await asyncio.create_subprocess_shell(
118118
cmd, env=env, cwd=cwd, stdout=PIPE, stderr=stderr, **kwargs
119119
)
@@ -255,7 +255,7 @@ def _create_command(self):
255255
six.moves.shlex_quote(arg) # pylint: disable=too-many-function-args
256256
for arg in self._args
257257
]
258-
return ["/bin/sh", "-c", '"./%s %s"' % (self._user_entry_point, " ".join(args))]
258+
return ["/bin/sh", "-c", './%s %s' % (self._user_entry_point, " ".join(args))]
259259

260260
def _python_command(self): # pylint: disable=no-self-use
261261
return [python_executable()]

0 commit comments

Comments
 (0)