rados.py broken with Python2.4

2012-03-20 Thread Nick Couchman
>>> On 2012/03/20 at 15:42, "Nick Couchman"  wrote: 
> Just noticed this with ceph-0.43 - ceph-0.39 does not have this issue.  I'm 
> trying to use Ceph on multiple platforms, one of which is CentOS 5.  CentOS 5 
> still uses Python 2.4, and byte-compilation of the rados.py file fails during 
> the build of ceph 0.43 with the following error:
> 
> Byte-compiling python modules...
> rados.py  File "/usr/lib/python2.4/site-packages/rados.py", line 422
> with self.lock:
> ^
> SyntaxError: invalid syntax
> 
> A quick Google search doesn't turn up anything obviously wrong with this 
> statement - just that Python 2.4 may not support this?  Is there anything 
> that 
> can be done to make this block of code (Ioctx, some of the aio stuff) 
> compatible with Python 2.4?
> 
> Thanks - Nick
> 
> 
> 

Apologies for the lack of subject line in the previous e-mail...bad form for a 
first post to this list!





This e-mail may contain confidential and privileged material for the sole use 
of the intended recipient.  If this email is not intended for you, or you are 
not responsible for the delivery of this message to the intended recipient, 
please note that this message may contain SEAKR Engineering (SEAKR) 
Privileged/Proprietary Information.  In such a case, you are strictly 
prohibited from downloading, photocopying, distributing or otherwise using this 
message, its contents or attachments in any way.  If you have received this 
message in error, please notify us immediately by replying to this e-mail and 
delete the message from your mailbox.  Information contained in this message 
that does not relate to the business of SEAKR is neither endorsed by nor 
attributable to SEAKR.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html


Re: rados.py broken with Python2.4

2012-03-20 Thread Tommi Virtanen
On Tue, Mar 20, 2012 at 14:47, Nick Couchman  wrote:
>> Just noticed this with ceph-0.43 - ceph-0.39 does not have this issue.  I'm
>> trying to use Ceph on multiple platforms, one of which is CentOS 5.  CentOS 5
>> still uses Python 2.4, and byte-compilation of the rados.py file fails during
>> the build of ceph 0.43 with the following error:
>>
>> Byte-compiling python modules...
>> rados.py  File "/usr/lib/python2.4/site-packages/rados.py", line 422
>>     with self.lock:
>>             ^
>> SyntaxError: invalid syntax
>>
>> A quick Google search doesn't turn up anything obviously wrong with this
>> statement - just that Python 2.4 may not support this?  Is there anything 
>> that
>> can be done to make this block of code (Ioctx, some of the aio stuff)
>> compatible with Python 2.4?

Python 2.4 does not support the with statement.

You should be able to replace that with

self.lock.acquire()
try:
cb = self.safe_cbs[completion]
del self.safe_cbs[completion]
finally:
self.lock.release()

I'm afraid we don't have resources to maintain Python support for
versions before 2.6; after all, 2.5 was released 5.5 years ago.
--
To unsubscribe from this list: send the line "unsubscribe ceph-devel" in
the body of a message to majord...@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html