[
https://issues.apache.org/jira/browse/CASSANDRA-10190?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=16777794#comment-16777794
]
Sangram Patil commented on CASSANDRA-10190:
-------------------------------------------
[~ptbannister]
Thank you very much for the details with necessary information. I have tried on
both the branches cqlshlib3 and cqlshlib6 as well.
In my environment Ubuntu 18.04 LTS, I have python3.6.7. When I try to import
cqlsh it throws the error. Copied below from my terminal
sangramp@cassandra-m:~$ python3
Python 3.6.7 (default, Oct 22 2018, 11:32:17)
[GCC 8.2.0] on linux
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
>>> sys.path.insert(0,'/home/sangramp/cassandra/bin')
>>> import cqlsh
Traceback (most recent call last) :
File "<stdin>", line 1, in <module>
File "/home/sangramp/cassandra/bin/cqlsh.py", line 168, in <module>
from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling,
cqlshhandling
File "/home/sangramp/cassandra/bin/../pylib/cqlshlib/cql3handling.py", line
19, in <module>
from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint
File "/home/sangramp/cassandra/bin/../pylib/cqlshlib/cqlhandling.py", line 23,
in <module>
from cqlshlib import pylexotron, util
File "/home/sangramp/cassandra/bin/../pylib/cqlshlib/pylexotron.py", line 342,
in <module>
class ParsingRuleSet:
File "/home/sangramp/cassandra/bin/../pylib/cqlshlib/pylexotron.py", line 354,
in ParsingRuleSet
], re.I | re.S | re.U)
File "/home/sangramp/cassandra/bin/../pylib/cqlshlib/saferscanner.py", line
41, in __init__
self.scanner = re.sre_compile.compile(p)
File "/usr/lib/python3.6/sre_compile.py", line 566, in compile
code = _code(p, flags)
File "/usr/lib/python3.6/sre_compile.py", line 551, in _code
_compile(code, p.data, flags)
File "/usr/lib/python3.6/sre_compile.py", line 187, in _compile
_compile(code, av, flags)
File "/usr/lib/python3.6/sre_compile.py", line 141, in _compile
group, add_flags, del_flags, p = av
ValueError: not enough values to unpack (expected 4, got 2)
However, in my another environment, where I have python 3.5.2, it does not
throw this exception at least.
Python 3.6.7 is in my production environment, where I need cqlsh to be
supported. Could you please have a quick look at the error and suggest me the
possible reason for the error or guide me to fix the error.
> Python 3 support for cqlsh
> --------------------------
>
> Key: CASSANDRA-10190
> URL: https://issues.apache.org/jira/browse/CASSANDRA-10190
> Project: Cassandra
> Issue Type: Improvement
> Components: Legacy/Tools
> Reporter: Andrew Pennebaker
> Priority: Major
> Labels: cqlsh
> Attachments: coverage_notes.txt
>
>
> Users who operate in a Python 3 environment may have trouble launching cqlsh.
> Could we please update cqlsh's syntax to run in Python 3?
> As a workaround, users can setup pyenv, and cd to a directory with a
> .python-version containing "2.7". But it would be nice if cqlsh supported
> modern Python versions out of the box.
--
This message was sent by Atlassian JIRA
(v7.6.3#76005)
---------------------------------------------------------------------
To unsubscribe, e-mail: [email protected]
For additional commands, e-mail: [email protected]