From 464ffca1e1fbb98107593ee60c43a8449e567eed Mon Sep 17 00:00:00 2001 From: Nicklas Larsson Date: Thu, 1 Dec 2022 20:54:15 +0100 Subject: [PATCH] grass.script: replace deprecated use of pipes.quote() (#2674) 'pipes' is deprecated since Python 3.11 and will be removed in version 3.13. 'pipes.quote()' is deprecated since version 2.7. --- python/grass/script/core.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/python/grass/script/core.py b/python/grass/script/core.py index 8290a02b000..6b64326e88c 100644 --- a/python/grass/script/core.py +++ b/python/grass/script/core.py @@ -27,7 +27,7 @@ import codecs import string import random -import pipes +import shlex from tempfile import NamedTemporaryFile from .utils import KeyValue, parse_key_val, basename, encode, decode, try_remove @@ -863,7 +863,7 @@ def parser(): sys.exit(1) cmdline = [basename(sys.argv[0])] - cmdline += [pipes.quote(a) for a in sys.argv[1:]] + cmdline += [shlex.quote(a) for a in sys.argv[1:]] os.environ["CMDLINE"] = " ".join(cmdline) argv = sys.argv[:]