This is an automated email from the ASF dual-hosted git repository.

stoty pushed a commit to branch master
in repository https://gitbox.apache.org/repos/asf/phoenix-queryserver.git


The following commit(s) were added to refs/heads/master by this push:
     new 3a7ffde  PHOENIX-7553 Python3.13 dropped support for pipes module 
(#175)
3a7ffde is described below

commit 3a7ffde42ae19fd31de986b6475fce4f977c4c26
Author: meszinorbi <104362890+meszino...@users.noreply.github.com>
AuthorDate: Wed Apr 2 16:04:20 2025 +0200

    PHOENIX-7553 Python3.13 dropped support for pipes module (#175)
---
 bin/queryserver.py | 13 +++++++++++--
 1 file changed, 11 insertions(+), 2 deletions(-)

diff --git a/bin/queryserver.py b/bin/queryserver.py
index 8120d9b..c0b9f64 100755
--- a/bin/queryserver.py
+++ b/bin/queryserver.py
@@ -43,6 +43,15 @@ except ImportError:
     # daemon script not supported on some platforms (windows?)
     daemon_supported = False
 
+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)
+
 import phoenix_queryserver_utils
 
 phoenix_queryserver_utils.setPath()
@@ -68,8 +77,8 @@ else:
 if os.name == 'nt':
     args = subprocess.list2cmdline(args)
 else:
-    import pipes    # pipes module isn't available on Windows
-    args = " ".join([pipes.quote(tryDecode(v)) for v in args])
+    # pipes module isn't available on Windows
+    args = " ".join([tryQuote(tryDecode(v)) for v in args])
 
 # HBase configuration folder path (where hbase-site.xml reside) for
 # HBase/Phoenix client side property override

Reply via email to