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

cqlsh can't handle python being a python3

    XMLWordPrintableJSON

    Details

    • Type: Bug
    • Status: Resolved
    • Priority: Low
    • Resolution: Fixed
    • Fix Version/s: 1.0.10, 1.1.0
    • Component/s: Legacy/Tools
    • Labels:
    • Environment:
    • Severity:
      Low

      Description

      cqlsh fails to run when python is a Python 3, with this error message:

      andrew@spite:~/src/cassandra-trunk/bin $ ./cqlsh 
        File "./cqlsh", line 97
          except ImportError, e:
                            ^
      SyntaxError: invalid syntax
      andrew@spite:~/src/cassandra-trunk/bin $ 
      

      The error occurs because the cqlsh script checks for a default installation of python that is older than a certain version, but not one newer that is incompatible (e.g. Python3). To fix this, I update the logic to only run python if it's a version at least 2.5 but before 3.0 If this version of python is in that range then role with it, otherwise try python2.6, python2.7, then python2.5 (no change from before).

      This is working on my installation, where python executes python 3.2.2 and doesn't break backwards compatibility to distributions that haven't made the jump to Python3 as default yet.

        Attachments

        1. python3-fix.patch
          0.5 kB
          Andrew Ash
        2. 4090.patch.txt
          0.7 kB
          paul cannon

          Activity

            People

            • Assignee:
              ash211 Andrew Ash
              Reporter:
              ash211 Andrew Ash
              Authors:
              Andrew Ash
              Reviewers:
              paul cannon
            • Votes:
              0 Vote for this issue
              Watchers:
              1 Start watching this issue

              Dates

              • Created:
                Updated:
                Resolved: