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

View File

@@ -41,7 +41,7 @@ A hub-managed service with no URL::
import asyncio import asyncio
import copy import copy
import os import os
import pipes import shlex
import shutil import shutil
from subprocess import Popen from subprocess import Popen
@@ -130,7 +130,7 @@ class _ServiceSpawner(LocalProcessSpawner):
env['SYSTEMROOT'] = os.environ['SYSTEMROOT'] env['SYSTEMROOT'] = os.environ['SYSTEMROOT']
cmd = self.cmd 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: try:
self.proc = Popen( self.proc = Popen(
self.cmd, self.cmd,

View File

@@ -6,7 +6,7 @@ Contains base Spawner class & default implementation
import ast import ast
import json import json
import os import os
import pipes import shlex
import shutil import shutil
import signal import signal
import sys import sys
@@ -1667,9 +1667,9 @@ class LocalProcessSpawner(Spawner):
if self.shell_cmd: if self.shell_cmd:
# using shell_cmd (e.g. bash -c), # using shell_cmd (e.g. bash -c),
# add our cmd list as the last (single) argument: # 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( popen_kwargs = dict(
preexec_fn=self.make_preexec_fn(self.user.name), preexec_fn=self.make_preexec_fn(self.user.name),