Skip to content
This repository was archived by the owner on Jun 27, 2025. It is now read-only.

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

Open
penfree wants to merge 3 commits into
twmht:masterfrom
penfree:master
Open

Fix for python 2.7: Exception AttributeError: "'list' object has no a…#54
penfree wants to merge 3 commits into
twmht:masterfrom
penfree:master

Conversation

@penfree

Copy link
Copy Markdown

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

…ttribute 'clear'" in 'rocksdb._rocksdb.DB.__dealloc__' ignored
@iFA88

Copy link
Copy Markdown

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

…ttribute 'clear'" in 'rocksdb._rocksdb.DB.__dealloc__' ignored
@iFA88

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

…ttribute 'clear'" in 'rocksdb._rocksdb.DB.__dealloc__' ignored
@penfree

Copy link
Copy Markdown
Author

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

ok, i have modified

@oersted

Copy link
Copy Markdown

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

@penfree

Copy link
Copy Markdown
Author

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

Sign up for freeto subscribe to this conversation on GitHub. Already have an account? Sign in.

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

@penfree@iFA88@oersted