This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author ned.deily
Recipients carltongibson, ned.deily, ronaldoussoren
Date 2021-04-08.20:28:29
SpamBayes Score -1.0
Marked as misclassified Yes
Message-id <1617913709.47.0.00893784800176.issue43773@roundup.psfhosted.org>
In-reply-to
Content
Thanks for the report. However, I think you've drawn the wrong conclusion form what you've observed. The reason you are unable to do what you are trying to do is that the _sqlite3 module included with the python.org macOS Pythons is statically linked with its own copy of an sqlite3 library, not dynamically linked. This has been true for a long time (10+ years); I believe the original reason was to avoid linking with the Apple-supplied system copy of the sqlite3 library.  You can see this by using otool:

- with the python.org 3.9.4:

$ /usr/local/bin/python3.9 -c 'import sys;print(sys.version)'
3.9.4 (v3.9.4:1f2e3088f3, Apr  4 2021, 12:19:19)
[Clang 12.0.0 (clang-1200.0.32.29)]
$ /usr/local/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)'
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so
$ otool -L $(/usr/local/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)')
/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so:
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)

- with a MacPorts python3.9.4:

$ /opt/macports/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)'
/opt/macports/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so
$ otool -L $(/opt/macports/bin/python3.9 -c 'import _sqlite3;print(_sqlite3.__file__)')
/opt/macports/Library/Frameworks/Python.framework/Versions/3.9/lib/python3.9/lib-dynload/_sqlite3.cpython-39-darwin.so:
	/opt/macports/lib/libsqlite3.0.dylib (compatibility version 9.0.0, current version 9.6.0)
	/usr/lib/libSystem.B.dylib (compatibility version 1.0.0, current version 1292.60.1)

If you want to replace the sqlite3 library, you would need to rebuild the _sqlite3 module. That's not something we would encourage or support.
History
Date User Action Args
2021-04-08 20:28:29ned.deilysetrecipients: + ned.deily, ronaldoussoren, carltongibson
2021-04-08 20:28:29ned.deilysetmessageid: <1617913709.47.0.00893784800176.issue43773@roundup.psfhosted.org>
2021-04-08 20:28:29ned.deilylinkissue43773 messages
2021-04-08 20:28:29ned.deilycreate