Uploaded image for project: 'Cassandra'
  1. Cassandra
  2. CASSANDRA-18088

cqlsh - module 're' has no attribute 'sre_parse' - with Python 3.11

    XMLWordPrintableJSON

Details

    Description

      User reported an error with cqlsh (Cassandra 4.0.7) on Stack Overflow: https://stackoverflow.com/questions/74673247/cannot-able-to-run-cqlsh-due-to-python-attribute-error

       

      Found out that the user was using Python 3.11, and I was able to reproduce it with that.

      % python3.11 bin/cqlsh.py
      Traceback (most recent call last):
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/cqlsh.py", line 159, in <module>
          from cqlshlib import cql3handling, cqlhandling, pylexotron, sslhandling, cqlshhandling
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cql3handling.py", line 19, in <module>
          from cqlshlib.cqlhandling import CqlParsingRuleSet, Hint
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/cqlhandling.py", line 23, in <module>
          from cqlshlib import pylexotron, util
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 342, in <module>
          class ParsingRuleSet:
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/pylexotron.py", line 343, in ParsingRuleSet
          RuleSpecScanner = SaferScanner([
                            ^^^^^^^^^^^^^^
        File "/Users/aaronploetz/local/apache-cassandra-4.0.7/bin/../pylib/cqlshlib/saferscanner.py", line 91, in {}init{}
          s = re.sre_parse.State()
              ^^^^^^^^^^^^

      AttributeError: module 're' has no attribute 'sre_parse'

      Appears to be something specific (again) with Python's synchronizing regex engine (SRE).  Works fine with Python 3.10, so there may have been a(nother) breaking change in that the re module with 3.11.

      Attachments

        1. saferscanner.py
          4 kB
          Godwin

        Issue Links

          Activity

            People

              brandon.williams Brandon Williams
              aploetz Aaron Ploetz
              Brandon Williams
              Berenguer Blasi
              Votes:
              0 Vote for this issue
              Watchers:
              9 Start watching this issue

              Dates

                Created:
                Updated:
                Resolved: