Skip to content

Commit 30f8ca1

Browse files
committed
Fix ModuleNotFoundError: No module named 'pipes'
https://docs.python.org/3/library/pipes.html Replaced deprecated module use with shlex.
1 parent 3dc1899 commit 30f8ca1

File tree

1 file changed

+6
-6
lines changed

1 file changed

+6
-6
lines changed

st2client/st2client/utils/httpclient.py

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
# Copyright 2020 The StackStorm Authors.
1+
# Copyright 2020-2026 The StackStorm Authors.
22
# Copyright 2019 Extreme Networks, Inc.
33
#
44
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -17,7 +17,7 @@
1717

1818
import json
1919
import logging
20-
from pipes import quote as pquote
20+
from shlex import quote
2121

2222
import requests
2323

@@ -185,18 +185,18 @@ def _get_curl_line_for_request(self, request):
185185
if method in ["HEAD"]:
186186
parts.extend(["--head"])
187187
else:
188-
parts.extend(["-X", pquote(method)])
188+
parts.extend(["-X", quote(method)])
189189

190190
# headers
191191
for key, value in request.headers.items():
192-
parts.extend(["-H ", pquote("%s: %s" % (key, value))])
192+
parts.extend(["-H ", quote("%s: %s" % (key, value))])
193193

194194
# body
195195
if request.body:
196-
parts.extend(["--data-binary", pquote(request.body)])
196+
parts.extend(["--data-binary", quote(request.body)])
197197

198198
# URL
199-
parts.extend([pquote(request.url)])
199+
parts.extend([quote(request.url)])
200200

201201
curl_line = " ".join(parts)
202202
return curl_line

0 commit comments

Comments
 (0)