Opened 13 years ago

Closed 10 years ago

#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: jyrkiwahlstedt
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 (5)

import_trace.txt (4.6 KB) - added by pfein@… 12 years ago.
ouput of python -v
regrtest.txt (82.2 KB) - added by pfein@… 12 years ago.
test_sqlite.txt (10.7 KB) - added by pfein@… 12 years ago.
ipython_error.txt (709 bytes) - added by pfein@… 12 years ago.
setup.py (870 bytes) - added by pfein@… 12 years ago.
setup.py to link against apple's sqlite

Download all attachments as: .zip

Change History (20)

comment:1 Changed 13 years ago by mf2k (Frank Schima)

Owner: changed from macports-tickets@… to mmw@…

comment:2 in reply to:  1 Changed 13 years ago by mmw@…

Replying to macsforever2000@macports.org:

to mww@… not mmw

comment:3 Changed 13 years ago by mmw@…

Owner: changed from mmw@… to mww@…

comment:4 Changed 12 years ago by mww@…

Priority: HighNormal
Status: newassigned

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 12 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

Changed 12 years ago by pfein@…

Attachment: import_trace.txt added

ouput of python -v

Changed 12 years ago by pfein@…

Attachment: regrtest.txt added

Changed 12 years ago by pfein@…

Attachment: test_sqlite.txt added

Changed 12 years ago by pfein@…

Attachment: ipython_error.txt added

comment:6 Changed 12 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 Changed 12 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 12 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

See #15163 for a tcl variant and #15169 for test failures

comment:9 Changed 12 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/

Changed 12 years ago by pfein@…

Attachment: setup.py added

setup.py to link against apple's sqlite

comment:10 Changed 12 years ago by dan.callahan@…

I can confirm that pfein's solution works for me.

comment:11 Changed 12 years ago by landonf (Landon Fuller)

Resolution: fixed
Status: assignedclosed

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 12 years ago by pfein@…

Resolution: fixed
Status: closedreopened

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:13 Changed 11 years ago by (none)

Milestone: Port Bugs

Milestone Port Bugs deleted

comment:14 Changed 10 years ago by jmroot (Joshua Root)

Cc: jwa@… added
Port: python25 sqlite3 added

comment:15 Changed 10 years ago by jmroot (Joshua Root)

Resolution: fixed
Status: reopenedclosed

Seems fine with current versions of python25 and sqlite3.

Note: See TracTickets for help on using tickets.