Merge pull request #4273 from minrk/rm-pipes

remove deprecated import of pipes.quote
This commit is contained in:
Simon Li
2022-12-15 13:59:15 +00:00
committed by GitHub
3 changed files with 7 additions and 7 deletions

View File

@@ -2,8 +2,8 @@
# Copyright (c) IPython Development Team.
# Distributed under the terms of the Modified BSD License.
import inspect
import pipes
import re
import shlex
import sys
import warnings
from concurrent.futures import ThreadPoolExecutor
@@ -958,7 +958,7 @@ class LocalAuthenticator(Authenticator):
except KeyError:
self.log.debug("No UID for user %s" % name)
cmd += [name]
self.log.info("Creating user: %s", ' '.join(map(pipes.quote, cmd)))
self.log.info("Creating user: %s", ' '.join(map(shlex.quote, cmd)))
p = Popen(cmd, stdout=PIPE, stderr=STDOUT)
p.wait()
if p.returncode:

View File

@@ -41,7 +41,7 @@ A hub-managed service with no URL::
import asyncio
import copy
import os
import pipes
import shlex
import shutil
from subprocess import Popen
@@ -130,7 +130,7 @@ class _ServiceSpawner(LocalProcessSpawner):
env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
cmd = self.cmd
self.log.info("Spawning %s", ' '.join(pipes.quote(s) for s in cmd))
self.log.info("Spawning %s", ' '.join(shlex.quote(s) for s in cmd))
try:
self.proc = Popen(
self.cmd,

View File

@@ -6,7 +6,7 @@ Contains base Spawner class & default implementation
import ast
import json
import os
import pipes
import shlex
import shutil
import signal
import sys
@@ -1667,9 +1667,9 @@ class LocalProcessSpawner(Spawner):
if self.shell_cmd:
# using shell_cmd (e.g. bash -c),
# add our cmd list as the last (single) argument:
cmd = self.shell_cmd + [' '.join(pipes.quote(s) for s in cmd)]
cmd = self.shell_cmd + [' '.join(shlex.quote(s) for s in cmd)]
self.log.info("Spawning %s", ' '.join(pipes.quote(s) for s in cmd))
self.log.info("Spawning %s", ' '.join(shlex.quote(s) for s in cmd))
popen_kwargs = dict(
preexec_fn=self.make_preexec_fn(self.user.name),