Skip to content

remove usage of ancient shellescape backport of Stdlib's shlex #2041

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Oct 4, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 2 additions & 2 deletions cwltool/command_line_tool.py
Original file line number Diff line number Diff line change
Expand Up @@ -7,6 +7,7 @@
import logging
import os
import re
import shlex
import shutil
import threading
import urllib
Expand All @@ -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
Expand Down Expand Up @@ -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:
Expand Down
4 changes: 2 additions & 2 deletions cwltool/job.py
Original file line number Diff line number Diff line change
Expand Up @@ -5,6 +5,7 @@
import math
import os
import re
import shlex
import shutil
import signal
import stat
Expand Down Expand Up @@ -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
Expand Down Expand Up @@ -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)
]
),
Expand Down
5 changes: 0 additions & 5 deletions mypy-stubs/shellescape/__init__.pyi

This file was deleted.

5 changes: 0 additions & 5 deletions mypy-stubs/shellescape/main.pyi

This file was deleted.

1 change: 0 additions & 1 deletion requirements.txt
Original file line number Diff line number Diff line change
@@ -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
Expand Down
1 change: 0 additions & 1 deletion setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down