diff --git a/cwltool/command_line_tool.py b/cwltool/command_line_tool.py index 7a4e8ff71..eb0b1a4f5 100644 --- a/cwltool/command_line_tool.py +++ b/cwltool/command_line_tool.py @@ -7,6 +7,7 @@ import logging import os import re +import shlex import shutil import threading import urllib @@ -31,7 +32,6 @@ cast, ) -import shellescape from mypy_extensions import mypyc_attr from ruamel.yaml.comments import CommentedMap, CommentedSeq from schema_salad.avro.schema import Schema @@ -1164,7 +1164,7 @@ def register_reader(f: CWLObjectType) -> None: for b in builder.bindings: arg = builder.generate_arg(b) if b.get("shellQuote", True): - arg = [shellescape.quote(a) for a in aslist(arg)] + arg = [shlex.quote(a) for a in aslist(arg)] cmd.extend(aslist(arg)) j.command_line = ["/bin/sh", "-c", " ".join(cmd)] else: diff --git a/cwltool/job.py b/cwltool/job.py index 817cb04c0..1731a5350 100644 --- a/cwltool/job.py +++ b/cwltool/job.py @@ -5,6 +5,7 @@ import math import os import re +import shlex import shutil import signal import stat @@ -35,7 +36,6 @@ ) import psutil -import shellescape from prov.model import PROV from schema_salad.sourceline import SourceLine from schema_salad.utils import json_dump, json_dumps @@ -271,7 +271,7 @@ def _execute( self.outdir, " \\\n ".join( [ - shellescape.quote(str(arg)) if shouldquote(str(arg)) else str(arg) + shlex.quote(str(arg)) if shouldquote(str(arg)) else str(arg) for arg in (runtime + self.command_line) ] ), diff --git a/mypy-stubs/shellescape/__init__.pyi b/mypy-stubs/shellescape/__init__.pyi deleted file mode 100644 index 621241e5e..000000000 --- a/mypy-stubs/shellescape/__init__.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for shellescape (Python 2) -# -# NOTE: This dynamically typed stub was automatically generated by stubgen. - -from .main import quote as quote diff --git a/mypy-stubs/shellescape/main.pyi b/mypy-stubs/shellescape/main.pyi deleted file mode 100644 index 69eade63e..000000000 --- a/mypy-stubs/shellescape/main.pyi +++ /dev/null @@ -1,5 +0,0 @@ -# Stubs for shellescape.main (Python 2) - -from typing import AnyStr - -def quote(s: AnyStr) -> AnyStr: ... diff --git a/requirements.txt b/requirements.txt index df82a6f43..b1fc2207d 100644 --- a/requirements.txt +++ b/requirements.txt @@ -1,7 +1,6 @@ requests>=2.6.1 ruamel.yaml>=0.16.0,<0.19 rdflib>=4.2.2,<7.1 -shellescape>=3.4.1,<3.9 schema-salad>=8.7,<9 prov==1.5.1 mypy-extensions diff --git a/setup.py b/setup.py index 5ddb526c1..9ab4f240e 100644 --- a/setup.py +++ b/setup.py @@ -126,7 +126,6 @@ # https://github.com/ionrock/cachecontrol/issues/137 "ruamel.yaml >= 0.16, < 0.19", "rdflib >= 4.2.2, < 7.1.0", - "shellescape >= 3.4.1, < 3.9", "schema-salad >= 8.7, < 9", "prov == 1.5.1", "mypy-extensions",