mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-17 06:52:59 +00:00
Merge pull request #4273 from minrk/rm-pipes
remove deprecated import of pipes.quote
This commit is contained in:
@@ -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:
|
||||
|
@@ -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,
|
||||
|
@@ -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),
|
||||
|
Reference in New Issue
Block a user