basho/riak-python-client — pull request #264 by pavel-kirienko (2013-06-29 11:04:20+00:00)
Title: Fixes ConflictError on non-existent objects

The recent refactoring altered the behavior of RiakObject in such a way that reading a non-existent key can raise ConflictError. This seems to be a bit wrong since empty object has no conflicting siblings, in fact such an object has no siblings at all.
``` python
>>> obj = riak_client.bucket('a_bucket').get('nonexistent')
>>> print obj.data
Traceback (most recent call last):
File "", line 1, in
File "riak/riak_object.py", line 45, in _getter
raise ConflictError()
riak.ConflictError: 'Object in conflict' # wrong
```

Proposed patch makes the RiakObject behave in the same way as before, returning None on attempt to read the empty data:
``` python
>>> obj = riak_client.bucket('a_bucket').get('nonexistent')
>>> print obj.data
None
```

One can suggest to raise a specialized exception in case of empty siblings list - seems OK to me too.