[PYCBC-256] Support Python3 asyncio ("Tulip") Created: 31/Jul/14  Updated: 31/Jul/14

Status: Open
Project: Couchbase Python Client Library
Component/s: None
Affects Version/s: None
Fix Version/s: .future
Security Level: Public

Type: Task Priority: Major
Reporter: Mark Nunberg Assignee: Mark Nunberg
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
asyncio, codenamed tulip, is now part of Python 3.4

https://docs.python.org/3/library/asyncio.html




[PYCBC-255] unlock() cas should be a name parameter? Created: 29/Jul/14  Updated: 29/Jul/14

Status: Open
Project: Couchbase Python Client Library
Component/s: library
Affects Version/s: 1.2.2
Fix Version/s: None
Security Level: Public

Type: Bug Priority: Minor
Reporter: Patrick Varley Assignee: Patrick Varley
Resolution: Unresolved Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
Everywhere else in the SDK cas is always a named parameter apart from unlock(key, cas).

It might be too late in the day to change this.

 Comments   
Comment by Patrick Varley [ 29/Jul/14 ]
Named and unnamed works the documentation only shows unnamed.




[PYCBC-254] Lock TTL=0 fails. Created: 29/Jul/14  Updated: 31/Jul/14  Resolved: 31/Jul/14

Status: Resolved
Project: Couchbase Python Client Library
Component/s: library
Affects Version/s: 1.2.2
Fix Version/s: 1.2.3
Security Level: Public

Type: Bug Priority: Major
Reporter: Patrick Varley Assignee: Mark Nunberg
Resolution: Fixed Votes: 0
Labels: None
Remaining Estimate: Not Specified
Time Spent: Not Specified
Original Estimate: Not Specified


 Description   
The documentation says "If set to 0 it will use the default lock timeout on the server."

http://pythonhosted.org/couchbase/api/couchbase.html#couchbase.connection.Connection.lock

However when I use ttl=0 I get this error:

Using PYCBC=1.2.2, LCB=('2.1.2', 131330)
Setting
6425942093814169600
Locking with: lock = cb.lock("lock", ttl=0)
Traceback (most recent call last):
  File "./lock.py", line 12, in <module>
    lock = cb.lock("lock", ttl=0)
  File "/Library/Python/2.7/site-packages/couchbase/connection.py", line 594, in lock
    return _Base.lock(self, key, ttl=ttl)
couchbase.exceptions.ArgumentError: <Lock must have an expiry, C Source=(src/get.c,107)>


Code example:

#!/usr/bin/python
import couchbase
from couchbase import Couchbase, Connection

print "Using PYCBC={0}, LCB={1}".format(couchbase.__version__, Connection.lcb_version())
cb = Couchbase.connect(bucket='default', host='localhost')

print "Setting"
doc = cb.set("lock","test")
print doc.cas
print "Locking with: " + 'lock = cb.lock("lock", ttl=0)'
lock = cb.lock("lock", ttl=0)
print lock.cas


 Comments   
Comment by Mark Nunberg [ 29/Jul/14 ]
hrm, I'll consider this a documentation bug since lock should always be used with a timeout to make the code easier to read (most things that "Lock", if not passed a timeout, lock indefinitely, while in the server there is always a maximum limit)
Comment by Mark Nunberg [ 30/Jul/14 ]
http://review.couchbase.org/#/c/40057/




Generated at Thu Jul 31 14:38:49 CDT 2014 using JIRA 5.2.4#845-sha1:c9f4cc41abe72fb236945343a1f485c2c844dac9.