Gentoo Archives: gentoo-user

From: William Kenworthy <billk@×××××××××.au>
To: gentoo-user@l.g.o
Subject: Re: [gentoo-user] ceph and a possible python problem
Date: Fri, 16 Aug 2013 23:27:33
Message-Id: 520EB50C.9020502@iinet.net.au
In Reply to: Re: [gentoo-user] ceph and a possible python problem by William Kenworthy
1 On 16/08/13 22:31, William Kenworthy wrote:
2 > On 16/08/13 22:15, Canek Peláez Valdés wrote:
3 >> On Fri, Aug 16, 2013 at 9:12 AM, William Kenworthy <billk@×××××××××.au> wrote:
4 >>> On 16/08/13 15:34, Keith Dart wrote:
5 >>>> Re , William Kenworthy said:
6 >>>>> olympus ~ # ceph
7 >>>>> File "/usr/bin/ceph", line 192
8 >>>>> print '\n', s, '\n', '=' * len(s)
9 >>>>> ^
10 >>>>> SyntaxError: invalid syntax
11 >>>>> olympus ~ #
12 >>>>
13 >>>>
14 >>>> In Python 3 "print" is a function, and should be called like this:
15 >>>>
16 >>>> print('\n', s, '\n', '=' * len(s))
17 >>>>
18 >>>> This works as-is in Python 2, unless you have this at the top of the
19 >>>> file:
20 >>>>
21 >>>> from __future__ import print_function
22 >>>>
23 >>>>
24 >>>> -- Keith
25 >>>>
26 >>>>
27 >>> Thanks Keith, that was suggested on the ceph list but grepping doesnt
28 >>> show it in the source. With this version of ceph they have replaced the
29 >>> "ceph" binary with a python script so its quite different from the older
30 >>> version which works. They target mainly centos and ubuntu/debian so I
31 >>> will have to keep looking.
32 >>
33 >> Have you tried a simple:
34 >>
35 >> python3 /usr/bin/ceph
36 >>
37 >> Regards.
38 >>
39 >
40 > No, doesnt work either. The ceph guys say it works fine for them which
41 > leaves me suspecting something is broken on my system ...
42 >
43 > BillK
44 >
45 >
46
47 Still not sure if I have a bug or a broken system.
48
49 1. If I use eselect to set python 3 and build ceph from the 9999 ebuild
50 it wont work
51 2. If I eselect python 2.7 it wont work
52 3. if I rebuild it with python 2.7 selected it now WORKS - yea!
53 4. if I eselect python 3.2 it wont work :(
54
55 Ok, I am suspecting that something in ceph isnt playing nicely with the
56 gentoo eselect system and having python2 and python3 on the system :(
57
58 I guess its pulling in something python2 when 3 is active which is where
59 the __future__ mechanism comes into play.
60
61 So next question is ... can I remove python2? - last I heard, portage
62 needs python2 and wont run properly with python3 - is that still the case?
63
64
65 BillK