From cd5f215c72dde43d367c065cdc9cd18d940623bd Mon Sep 17 00:00:00 2001 From: Stefan Miklosovic Date: Fri, 25 Mar 2022 21:37:45 +0100 Subject: [PATCH] ninja: expand user paths for cqlsh.py as part of CASSANDRA-17448 patch by Stefan Miklosovic; reviewed by Brandon Williams for CASSANDRA-17448 --- bin/cqlsh.py | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/cqlsh.py b/bin/cqlsh.py index 4579fda06c..ad2a213e0e 100755 --- a/bin/cqlsh.py +++ b/bin/cqlsh.py @@ -249,10 +249,10 @@ try: except OSError: print('\nWarning: Cannot create directory at `%s`. Command history will not be saved. Please check what was the environment property CQL_HISTORY set to.\n' % HISTORY_DIR) -DEFAULT_CQLSHRC = os.path.join('~', '.cassandra', 'cqlshrc') +DEFAULT_CQLSHRC = os.path.expanduser(os.path.join('~', '.cassandra', 'cqlshrc')) if hasattr(options, 'cqlshrc'): - CONFIG_FILE = options.cqlshrc + CONFIG_FILE = os.path.expanduser(options.cqlshrc) if not os.path.exists(CONFIG_FILE): print('\nWarning: Specified cqlshrc location `%s` does not exist. Using `%s` instead.\n' % (CONFIG_FILE, DEFAULT_CQLSHRC)) CONFIG_FILE = DEFAULT_CQLSHRC