Loading lib/galaxy/datatypes/text.py +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ import json import logging import os import re import shlex import subprocess import tempfile Loading @@ -28,6 +27,7 @@ from galaxy.datatypes.sniff import ( ) from galaxy.util import ( nice_size, shlex_join, string_as_bool, unicodify, ) Loading Loading @@ -219,7 +219,7 @@ class Ipynb(Json): ofilename = dataset.file_name log.exception( 'Command "%s" failed. Could not convert the Jupyter Notebook to HTML, defaulting to plain text.', " ".join(map(shlex.quote, cmd)), shlex_join(cmd), ) return open(ofilename, mode="rb"), headers Loading lib/galaxy/tool_util/deps/conda_util.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import json import logging import os import re import shlex import shutil import sys import tempfile Loading @@ -18,6 +17,7 @@ import packaging.version from galaxy.util import ( commands, listify, shlex_join, smart_str, which, ) Loading Loading @@ -237,7 +237,7 @@ class CondaContext(installable.InstallableContext): env = {} if self.condarc_override: env["CONDARC"] = self.condarc_override cmd_string = " ".join(map(shlex.quote, cmd)) cmd_string = shlex_join(cmd) kwds = dict() try: if stdout_path: Loading lib/galaxy/tool_util/deps/mulled/mulled_build.py +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,6 @@ Build a mulled image with: import json import logging import os import shlex import shutil import stat import string Loading @@ -31,6 +30,7 @@ from galaxy.tool_util.deps.docker_util import command_list as docker_command_lis from galaxy.util import ( commands, safe_makedirs, shlex_join, unicodify, ) from ._cli import arg_parser Loading Loading @@ -301,7 +301,7 @@ def mull_targets( involucro_args.insert(6, "-set") involucro_args.insert(7, f"TEST_BINDS={','.join(test_bind)}") cmd = involucro_context.build_command(involucro_args) print(f"Executing: {' '.join(shlex.quote(_) for _ in cmd)}") print(f"Executing: {shlex_join(cmd)}") if dry_run: return 0 ensure_installed(involucro_context, True) Loading lib/galaxy/util/__init__.py +9 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import json import os import random import re import shlex import shutil import smtplib import stat Loading Loading @@ -77,6 +78,14 @@ from .path import ( # noqa: F401 safe_relpath, ) try: shlex_join = shlex.join # type: ignore[attr-defined] except AttributeError: # Python < 3.8 def shlex_join(split_command): return " ".join(map(shlex.quote, split_command)) inflector = Inflector() log = get_logger(__name__) Loading lib/galaxy/util/path/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -365,7 +365,7 @@ def external_chown(path, pwent, external_chown_script, description="file"): cmd = shlex.split(external_chown_script) cmd.extend([path, pwent[0], str(pwent[3])]) log.debug(f"Changing ownership of {path} with: {' '.join(map(shlex.quote, cmd))}") log.debug(f"Changing ownership of {path} with: '{galaxy.util.shlex_join(cmd)}'") galaxy.util.commands.execute(cmd) return True except galaxy.util.commands.CommandLineException as e: Loading Loading
lib/galaxy/datatypes/text.py +2 −2 Original line number Diff line number Diff line Loading @@ -6,7 +6,6 @@ import json import logging import os import re import shlex import subprocess import tempfile Loading @@ -28,6 +27,7 @@ from galaxy.datatypes.sniff import ( ) from galaxy.util import ( nice_size, shlex_join, string_as_bool, unicodify, ) Loading Loading @@ -219,7 +219,7 @@ class Ipynb(Json): ofilename = dataset.file_name log.exception( 'Command "%s" failed. Could not convert the Jupyter Notebook to HTML, defaulting to plain text.', " ".join(map(shlex.quote, cmd)), shlex_join(cmd), ) return open(ofilename, mode="rb"), headers Loading
lib/galaxy/tool_util/deps/conda_util.py +2 −2 Original line number Diff line number Diff line Loading @@ -4,7 +4,6 @@ import json import logging import os import re import shlex import shutil import sys import tempfile Loading @@ -18,6 +17,7 @@ import packaging.version from galaxy.util import ( commands, listify, shlex_join, smart_str, which, ) Loading Loading @@ -237,7 +237,7 @@ class CondaContext(installable.InstallableContext): env = {} if self.condarc_override: env["CONDARC"] = self.condarc_override cmd_string = " ".join(map(shlex.quote, cmd)) cmd_string = shlex_join(cmd) kwds = dict() try: if stdout_path: Loading
lib/galaxy/tool_util/deps/mulled/mulled_build.py +2 −2 Original line number Diff line number Diff line Loading @@ -12,7 +12,6 @@ Build a mulled image with: import json import logging import os import shlex import shutil import stat import string Loading @@ -31,6 +30,7 @@ from galaxy.tool_util.deps.docker_util import command_list as docker_command_lis from galaxy.util import ( commands, safe_makedirs, shlex_join, unicodify, ) from ._cli import arg_parser Loading Loading @@ -301,7 +301,7 @@ def mull_targets( involucro_args.insert(6, "-set") involucro_args.insert(7, f"TEST_BINDS={','.join(test_bind)}") cmd = involucro_context.build_command(involucro_args) print(f"Executing: {' '.join(shlex.quote(_) for _ in cmd)}") print(f"Executing: {shlex_join(cmd)}") if dry_run: return 0 ensure_installed(involucro_context, True) Loading
lib/galaxy/util/__init__.py +9 −0 Original line number Diff line number Diff line Loading @@ -13,6 +13,7 @@ import json import os import random import re import shlex import shutil import smtplib import stat Loading Loading @@ -77,6 +78,14 @@ from .path import ( # noqa: F401 safe_relpath, ) try: shlex_join = shlex.join # type: ignore[attr-defined] except AttributeError: # Python < 3.8 def shlex_join(split_command): return " ".join(map(shlex.quote, split_command)) inflector = Inflector() log = get_logger(__name__) Loading
lib/galaxy/util/path/__init__.py +1 −1 Original line number Diff line number Diff line Loading @@ -365,7 +365,7 @@ def external_chown(path, pwent, external_chown_script, description="file"): cmd = shlex.split(external_chown_script) cmd.extend([path, pwent[0], str(pwent[3])]) log.debug(f"Changing ownership of {path} with: {' '.join(map(shlex.quote, cmd))}") log.debug(f"Changing ownership of {path} with: '{galaxy.util.shlex_join(cmd)}'") galaxy.util.commands.execute(cmd) return True except galaxy.util.commands.CommandLineException as e: Loading