问题
My machine:
Linux pcname 4.9.0-9-amd64 #1 SMP Debian 4.9.168-1+deb9u3 (2019-06-16) x86_64 GNU/Linux
Have two python3 in the system:
root@pcname: # update-alternatives --list python3
/usr/bin/python3.5
/usr/local/bin/python3.9
When I use python3.9
import sys
import sqlite3
import faulthandler
print('python3', sys.version_info)
print('sqlite3', sqlite3.sqlite_version)
print()
faulthandler.enable()
conn = sqlite3.connect("testdb")
$ python3 test.py
python3 sys.version_info(major=3, minor=9, micro=0, releaselevel='final', serial=0)
sqlite3 3.16.2
Fatal Python error: Segmentation fault
Current thread 0x00007f1d63efc500 (most recent call first):
File "/home/user/test.py", line 8 in
Segmentation fault
Even if
...
conn = sqlite3.connect(":memory:")
I get the same.
Why? What is wrong ? What I gotta do (to make you love me) ?
I had this issue before.
When I choose python3.5 with update-alternatives it works just fine.
$ python3 test.py
python3 sys.version_info(major=3, minor=5, micro=3, releaselevel='final', serial=0)
sqlite3 3.16.2
来源:https://stackoverflow.com/questions/65342799/python3-9-sqlite2-connect-always-give-segmentation-fault