mirror of
https://github.com/jupyterhub/jupyterhub.git
synced 2025-10-18 07:23:00 +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.
|
# 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:
|
||||||
|
@@ -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,
|
||||||
|
@@ -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),
|
||||||
|
Reference in New Issue
Block a user