Skip to content

Commit 75e073c

Browse files
authored
remove usage of ancient shellescape backport of Stdlib's shlex (#2041)
1 parent 48cea18 commit 75e073c

File tree

6 files changed

+4
-16
lines changed

6 files changed

+4
-16
lines changed

cwltool/command_line_tool.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
import logging
88
import os
99
import re
10+
import shlex
1011
import shutil
1112
import threading
1213
import urllib
@@ -31,7 +32,6 @@
3132
cast,
3233
)
3334

34-
import shellescape
3535
from mypy_extensions import mypyc_attr
3636
from ruamel.yaml.comments import CommentedMap, CommentedSeq
3737
from schema_salad.avro.schema import Schema
@@ -1164,7 +1164,7 @@ def register_reader(f: CWLObjectType) -> None:
11641164
for b in builder.bindings:
11651165
arg = builder.generate_arg(b)
11661166
if b.get("shellQuote", True):
1167-
arg = [shellescape.quote(a) for a in aslist(arg)]
1167+
arg = [shlex.quote(a) for a in aslist(arg)]
11681168
cmd.extend(aslist(arg))
11691169
j.command_line = ["/bin/sh", "-c", " ".join(cmd)]
11701170
else:

cwltool/job.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import math
66
import os
77
import re
8+
import shlex
89
import shutil
910
import signal
1011
import stat
@@ -35,7 +36,6 @@
3536
)
3637

3738
import psutil
38-
import shellescape
3939
from prov.model import PROV
4040
from schema_salad.sourceline import SourceLine
4141
from schema_salad.utils import json_dump, json_dumps
@@ -271,7 +271,7 @@ def _execute(
271271
self.outdir,
272272
" \\\n ".join(
273273
[
274-
shellescape.quote(str(arg)) if shouldquote(str(arg)) else str(arg)
274+
shlex.quote(str(arg)) if shouldquote(str(arg)) else str(arg)
275275
for arg in (runtime + self.command_line)
276276
]
277277
),

mypy-stubs/shellescape/__init__.pyi

-5
This file was deleted.

mypy-stubs/shellescape/main.pyi

-5
This file was deleted.

requirements.txt

-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
requests>=2.6.1
22
ruamel.yaml>=0.16.0,<0.19
33
rdflib>=4.2.2,<7.1
4-
shellescape>=3.4.1,<3.9
54
schema-salad>=8.7,<9
65
prov==1.5.1
76
mypy-extensions

setup.py

-1
Original file line numberDiff line numberDiff line change
@@ -126,7 +126,6 @@
126126
# https://github.com/ionrock/cachecontrol/issues/137
127127
"ruamel.yaml >= 0.16, < 0.19",
128128
"rdflib >= 4.2.2, < 7.1.0",
129-
"shellescape >= 3.4.1, < 3.9",
130129
"schema-salad >= 8.7, < 9",
131130
"prov == 1.5.1",
132131
"mypy-extensions",

0 commit comments

Comments
 (0)