diff --git a/src/python/grpcio/grpc/_server.py b/src/python/grpcio/grpc/_server.py index 595056136b7..4ea1d5e4597 100644 --- a/src/python/grpcio/grpc/_server.py +++ b/src/python/grpcio/grpc/_server.py @@ -579,7 +579,7 @@ def _call_behavior( exception.__traceback__, ) ) - traceback.print_exc() + traceback.print_exc() _LOGGER.exception(details) _abort( state, diff --git a/tools/run_tests/run_performance_tests.py b/tools/run_tests/run_performance_tests.py index 808bc0a30bf..064dbf3328d 100755 --- a/tools/run_tests/run_performance_tests.py +++ b/tools/run_tests/run_performance_tests.py @@ -21,8 +21,8 @@ import collections import itertools import json import os -import pipes import re +import shlex import sys import time @@ -121,7 +121,7 @@ def create_scenario_jobspec( if bq_result_table: cmd += 'BQ_RESULT_TABLE="%s" ' % bq_result_table cmd += "tools/run_tests/performance/run_qps_driver.sh " - cmd += "--scenarios_json=%s " % pipes.quote( + cmd += "--scenarios_json=%s " % shlex.quote( json.dumps({"scenarios": [scenario_json]}) ) cmd += "--scenario_result_file=scenario_result.json " @@ -135,7 +135,7 @@ def create_scenario_jobspec( user_at_host = "%s@%s" % (_REMOTE_HOST_USERNAME, remote_host) cmd = 'ssh %s "cd ~/performance_workspace/grpc/ && "%s' % ( user_at_host, - pipes.quote(cmd), + shlex.quote(cmd), ) return jobset.JobSpec( @@ -157,7 +157,7 @@ def create_quit_jobspec(workers, remote_host=None): user_at_host = "%s@%s" % (_REMOTE_HOST_USERNAME, remote_host) cmd = 'ssh %s "cd ~/performance_workspace/grpc/ && "%s' % ( user_at_host, - pipes.quote(cmd), + shlex.quote(cmd), ) return jobset.JobSpec( @@ -192,7 +192,7 @@ def create_netperf_jobspec( user_at_host = "%s@%s" % (_REMOTE_HOST_USERNAME, client_host) cmd = 'ssh %s "cd ~/performance_workspace/grpc/ && "%s' % ( user_at_host, - pipes.quote(cmd), + shlex.quote(cmd), ) return jobset.JobSpec( diff --git a/tools/run_tests/run_tests.py b/tools/run_tests/run_tests.py index 88a9a648bbd..091817a065a 100755 --- a/tools/run_tests/run_tests.py +++ b/tools/run_tests/run_tests.py @@ -26,10 +26,10 @@ import logging import multiprocessing import os import os.path -import pipes import platform import random import re +import shlex import socket import subprocess import sys @@ -479,7 +479,7 @@ class CLanguage(object): cmdline = [binary] + target["args"] shortname = target.get( "shortname", - " ".join(pipes.quote(arg) for arg in cmdline), + " ".join(shlex.quote(arg) for arg in cmdline), ) shortname += shortname_ext out.append(