This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch 5.2
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.2 by this push:
new f3460a0d8a PHOENIX-7553 Python3.13 dropped support for pipes module
(#2096)
f3460a0d8a is described below
commit f3460a0d8a8f8a6b17ddbccede0fdfc4db7b2535
Author: meszinorbi <[email protected]>
AuthorDate: Wed Apr 2 16:01:22 2025 +0200
PHOENIX-7553 Python3.13 dropped support for pipes module (#2096)
---
bin/phoenix_utils.py | 12 ++++++++++--
1 file changed, 10 insertions(+), 2 deletions(-)
diff --git a/bin/phoenix_utils.py b/bin/phoenix_utils.py
index 3ee8014ada..86919a1e0b 100755
--- a/bin/phoenix_utils.py
+++ b/bin/phoenix_utils.py
@@ -52,6 +52,15 @@ def tryDecode(input):
except:
return input
+def tryQuote(unquoted_input):
+ """ Python 2/3 compatibility hack
+ """
+ try:
+ from shlex import quote as cmd_quote
+ except ImportError:
+ from pipes import quote as cmd_quote
+ return cmd_quote(unquoted_input)
+
def findFileInPathWithoutRecursion(pattern, path):
if not os.path.exists(path):
return ""
@@ -210,8 +219,7 @@ def shell_quote(args):
return subprocess.list2cmdline(args)
else:
# pipes module isn't available on Windows
- import pipes
- return " ".join([pipes.quote(tryDecode(v)) for v in args])
+ return " ".join([tryQuote(tryDecode(v)) for v in args])
def __set_java():
global java_home