This is an automated email from the ASF dual-hosted git repository.
stoty pushed a commit to branch 5.1
in repository https://gitbox.apache.org/repos/asf/phoenix.git
The following commit(s) were added to refs/heads/5.1 by this push:
new e17fedb1aa PHOENIX-7553 Python3.13 dropped support for pipes module
(#2096)
e17fedb1aa is described below
commit e17fedb1aa6d3937526c9930a3dd5ae4d8e246e6
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 22f344475a..c48c9d0e7a 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 ""
@@ -204,8 +213,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