Open artelse opened 2 years ago
Use python 3.8. For Python 3.10, it doesn't work for some reason
According to https://getdocs.org/Python/docs/3.10/whatsnew/3.10, those depricated calls were removed: PEP 624, Remove Py_UNICODE encoder APIs. Here https://www.python.org/download/releases/3.0/whatsnew/ they say:
The undocumented C APIs PyUnicode_AsString() and PyUnicode_AsStringAndSize() were made private to the interpreter, in order to be able to refine their interfaces for Python 3.1.
If you need to access the UTF-8 representation of a Unicode object as bytes string, please use PyUnicode_AsUTF8String() instead.
Hope this is useful?
Yes, for me it worked to replace all occurrences of _PyUnicode_AsStringAndSize
with PyUnicode_AsUTF8AndSize
everywhere in src/python3/*.c
Great, that worked for me as well.
python3 setup.py build
then python3 setup.py install
When I try to import sqlcipher
from pysqlcipher3 import dbapi2 as sqlcipher
, this error is emitted:ImportError: /home/nn/.local/lib/python3.10/site-packages/pysqlcipher3/_sqlite3.cpython-310-x86_64-linux-gnu.so: undefined symbol: _PyUnicode_AsStringAndSize
This is on linux with a compiled sqlcipher:
./configure --enable-tempstore=yes CFLAGS="-DSQLITE_HAS_CODEC" \ LDFLAGS="-lcrypto -lsqlite3
Any idea how to resolve?