cassandra-commits mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Andrew Ash (Commented) (JIRA)" <j...@apache.org>
Subject [jira] [Commented] (CASSANDRA-4090) cqlsh can't handle python being a python3
Date Tue, 03 Apr 2012 02:14:23 GMT

    [ https://issues.apache.org/jira/browse/CASSANDRA-4090?page=com.atlassian.jira.plugin.system.issuetabpanels:comment-tabpanel&focusedCommentId=13244923#comment-13244923
] 

Andrew Ash commented on CASSANDRA-4090:
---------------------------------------

Paul's patch looks good to me, and I agree that python being a python3
is nonstandard. An easy fix to support though, and flipping the error
code is right too.

Anything else needed before applying the patch to trunk?

Thanks!

On Apr 2, 2012, at 16:37, "paul cannon (Updated) (JIRA)"


                
> cqlsh can't handle python being a python3
> -----------------------------------------
>
>                 Key: CASSANDRA-4090
>                 URL: https://issues.apache.org/jira/browse/CASSANDRA-4090
>             Project: Cassandra
>          Issue Type: Bug
>    Affects Versions: 1.0.8
>         Environment: On Archlinux, where Python3 installations are default (most distros
currently use Python2 as default now)
> {code}
> $ ls -l `which python` 
> lrwxrwxrwx 1 root root 7 Nov 21 09:05 /usr/bin/python -> python3
> {code}
>            Reporter: Andrew Ash
>            Assignee: Andrew Ash
>         Attachments: 4090.patch.txt, python3-fix.patch
>
>
> cqlsh fails to run when {{python}} is a Python 3, with this error message:
> {code}
> andrew@spite:~/src/cassandra-trunk/bin $ ./cqlsh 
>   File "./cqlsh", line 97
>     except ImportError, e:
>                       ^
> SyntaxError: invalid syntax
> andrew@spite:~/src/cassandra-trunk/bin $ 
> {code}
> 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.

--
This message is automatically generated by JIRA.
If you think it was sent incorrectly, please contact your JIRA administrators: https://issues.apache.org/jira/secure/ContactAdministrators!default.jspa
For more information on JIRA, see: http://www.atlassian.com/software/jira

        

Mime
View raw message