Remove pipes module and use shlex instead

Thanks: https://github.com/tox-dev/tox/pull/2418/files

Closes #373
This commit is contained in:
Moon Sungjoon 2023-07-23 11:30:27 +09:00 committed by Alex Pyrgiotis
parent 47b337143c
commit 494f498d17
No known key found for this signature in database
GPG key ID: B6C15EBA0357C9AA
2 changed files with 4 additions and 5 deletions

View file

@ -1,6 +1,5 @@
import logging
import os
import pipes
import platform
import shlex
import subprocess
@ -68,7 +67,7 @@ class DangerzoneGui(DangerzoneCore):
args = ["open", "-a", "Preview.app", filename]
# Run
args_str = " ".join(pipes.quote(s) for s in args)
args_str = " ".join(shlex.quote(s) for s in args)
log.info(Fore.YELLOW + "> " + Fore.CYAN + args_str)
subprocess.run(args)
@ -89,7 +88,7 @@ class DangerzoneGui(DangerzoneCore):
args[i] = filename
# Open as a background process
args_str = " ".join(pipes.quote(s) for s in args)
args_str = " ".join(shlex.quote(s) for s in args)
log.info(Fore.YELLOW + "> " + Fore.CYAN + args_str)
subprocess.Popen(args)

View file

@ -3,8 +3,8 @@ import json
import logging
import os
import pathlib
import pipes
import platform
import shlex
import shutil
import subprocess
import tempfile
@ -152,7 +152,7 @@ class Container(IsolationProvider):
document: Document,
args: List[str],
) -> int:
args_str = " ".join(pipes.quote(s) for s in args)
args_str = " ".join(shlex.quote(s) for s in args)
log.info("> " + args_str)
with subprocess.Popen(