python-rocksdb icon indicating copy to clipboard operation
python-rocksdb copied to clipboard

Fix for python 2.7: Exception AttributeError: "'list' object has no a…

Open penfree opened this issue 6 years ago • 5 comments

AttributeError: 'list' object has no attribute 'clear' Exception AttributeError: "'list' object has no attribute 'clear'" in 'rocksdb._rocksdb.DB.dealloc' ignored

penfree avatar May 28 '19 12:05 penfree

Hi. del variable[:] Should be the correct method for .clear(), and then is python 2 compatible.

iFA88 avatar May 28 '19 12:05 iFA88

>>> data = [1,2,3]
>>> ptr = data
>>> del data[:]
>>> ptr.append(4)
>>> data
[4]
>>> 
>>> 
>>> data = [1,2,3]
>>> ptr = data
>>> data = []
>>> ptr.append(4)
>>> data
[]

iFA88 avatar May 28 '19 12:05 iFA88

Hi. del variable[:] Should be the correct method for .clear(), and then is python 2 compatible.

ok, i have modified

penfree avatar May 28 '19 12:05 penfree

Is there an alternative to properly deallocate the DB object in Python 2 from outside until this is released?

oersted avatar Jun 19 '19 13:06 oersted

Is there an alternative to properly deallocate the DB object in Python 2 from outside until this is released?

pip install -U https://github.com/penfree/python-rocksdb/archive/master.zip

you can just use my branch or fork and fix it before new release

penfree avatar Oct 18 '19 06:10 penfree