py-leveldb-windows icon indicating copy to clipboard operation
py-leveldb-windows copied to clipboard

import leveldb error, it said: SystemError: GetStats() method: bad call flags

Open CryptoCoinLab opened this issue 4 years ago • 1 comments

I succeed in compiling under Visual Studio 2019 on Windows 8 with python 3.9, and I copy leveldb.pyd to the directory of python39/Lib/site-packages.

Then I run test-py3-leveldb.py, and I got error as following:

Traceback (most recent call last): File "D:\BlockProjects\test_levedb.py", line 3, in import leveldb SystemError: GetStats() method: bad call flags

how to solve this issue ?

CryptoCoinLab avatar Feb 03 '21 14:02 CryptoCoinLab

I compiled under Visual Studio 2019 on Windows 10 with python 3.8 and I got the same error. I solved the issue in my environment:

  1. edit the leveldb_object.cc file, 766th line, delete "METH_VARARGS | ".
  2. recompile the project. image

zhujunling-nj avatar May 25 '22 06:05 zhujunling-nj