Ticket #15131 (closed defect: fixed)
py25-sqlite3 2.5.2 totally broken
| Reported by: | pfein@… | Owned by: | mww@… |
|---|---|---|---|
| Priority: | Normal | Milestone: | |
| Component: | ports | Version: | 1.6.0 |
| Keywords: | Cc: | jwa@… | |
| Port: | python25 sqlite3 |
Description
With a fresh install of Python 2.5.2 and py25-sqlite3, the module doesn't work at all:
In [1]: import sqlite3
In [2]: conn=sqlite3.connect(":memory:")
---------------------------------------------------------------------------
SystemError Traceback (most recent call last)
/Users/pfein/<ipython console> in <module>()
SystemError: NULL result without error in PyObject_Call
Attachments
Change History
comment:1 follow-up: ↓ 2 Changed 5 years ago by macsforever2000@…
- Owner changed from macports-tickets@… to mmw@…
comment:2 in reply to: ↑ 1 Changed 5 years ago by mmw@…
Replying to macsforever2000@macports.org:
to mww@… not mmw
comment:4 Changed 5 years ago by mww@…
- Priority changed from High to Normal
- Status changed from new to assigned
works flawless here -- which arch and version of OS X do you use? Which version of sqlite3 is this? Please also provide a full trace
echo "import sqlite3 conn=sqlite3.connect(\":memory:\") " | python2.5 -v
comment:5 Changed 5 years ago by pfein@…
This only seems to be provoked when some other modules are loaded (maybe threads?)
I'm attaching the output of the command you requested, plus runs from Python's source regression suite. The sqlite tests fail when run as part of the entire suite, but pass on their own.
Intel Leopard 10.5.2
hotbox:~$ uname -a Darwin hotbox.local 9.2.0 Darwin Kernel Version 9.2.0: Tue Feb 5 16:13:22 PST 2008; root:xnu-1228.3.13~1/RELEASE_I386 i386
comment:6 Changed 5 years ago by pfein@…
I'm seeing the same error with externally built pysqlite2: http://www.initd.org/pub/software/pysqlite/releases/2.4/2.4.1/
This makes me suspect my python installation itself is fubar. ;-(
The only remotely relevant google hits involve mod_python/mod_cache, which isn't at issue here.
Help please, I don't want to go use fink, but I have to get some work done.
comment:7 follow-up: ↓ 8 Changed 5 years ago by pfein@…
Both I and another user on IRC with the same configuration were able to reproduce this problem.
This problem may be with sqlite3 itself, but I'm currently unable to run the tests for that, as there's no tclsqlite3 port. See also #6810
comment:8 in reply to: ↑ 7 Changed 5 years ago by pfein@…
Replying to pfein@pobox.com:
This problem may be with sqlite3 itself, but I'm currently unable to run the tests for that, as there's no tclsqlite3 port. See also #6810
comment:9 Changed 5 years ago by pfein@…
I built a _sqlite3.so linked against Apple's sqlite:
otool -L _sqlite3.so _sqlite3.so: /usr/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 111.0.0)
All reported problems disappear with this build.
To build:
- download and extract Python-2.5.2 source
- copy Modules/_sqlite/ to /some/where/_sqlite/
- download attached setup.py to /some/where/
- run /opt/local/bin/python /some/where/setup.py install This will install _sqlite3.so to /opt/local/lib/python2.5/site-packages/
comment:10 Changed 5 years ago by dan.callahan@…
I can confirm that pfein's solution works for me.
comment:11 follow-up: ↓ 12 Changed 5 years ago by landonf@…
- Status changed from assigned to closed
- Resolution set to fixed
Older SQLite ports did not build with a two-level namespace and Apple's frameworks link to the system sqlite -- when/if a Python module links against one of those Apple frameworks, MacPorts sqlite and Apple sqlite conflict.
Upgrade to the latest SQLite port (3.5.9), which should correctly build two-level namespace.
comment:12 in reply to: ↑ 11 Changed 5 years ago by pfein@…
- Status changed from closed to reopened
- Resolution fixed deleted
Replying to landonf@macports.org:
Older SQLite ports did not build with a two-level namespace and Apple's frameworks link to the system sqlite -- when/if a Python module links against one of those Apple frameworks, MacPorts sqlite and Apple sqlite conflict.
Upgrade to the latest SQLite port (3.5.9), which should correctly build two-level namespace.
This bug is against py25-sqlite3 built against macports sqlite 3.5.9. The attached setup.py for py25-sqlite3 purposefully links against Apple's sqlite as a temporary workaround because Macports' sqlite is broken - see #15169.
Reopening, since the closer clearly missed the point. ;-)
comment:15 Changed 3 years ago by jmr@…
- Status changed from reopened to closed
- Resolution set to fixed
Seems fine with current versions of python25 and sqlite3.

