Projects
New Ticket     Wiki     Browse Source     Timeline     Roadmap     Bug Reports     Search

Ticket #15131 (reopened defect)

Opened 7 months ago

Last modified 5 months ago

py25-sqlite3 2.5.2 totally broken

Reported by: pfein@… Owned by: mww@…
Priority: Normal Milestone: Port Bugs
Component: ports Version: 1.6.0
Keywords: Cc:
Port:

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

import_trace.txt (4.6 KB) - added by pfein@… 7 months ago.
ouput of python -v
regrtest.txt (82.2 KB) - added by pfein@… 7 months ago.
test_sqlite.txt (10.7 KB) - added by pfein@… 7 months ago.
ipython_error.txt (0.7 KB) - added by pfein@… 7 months ago.
setup.py (0.8 KB) - added by pfein@… 7 months ago.
setup.py to link against apple's sqlite

Change History

follow-up: ↓ 2   Changed 7 months ago by macsforever2000@…

  • owner changed from macports-tickets@… to mmw@…

in reply to: ↑ 1   Changed 7 months ago by mmw@…

Replying to macsforever2000@macports.org:

to mww@… not mmw

  Changed 7 months ago by mmw@…

  • owner changed from mmw@… to mww@…

  Changed 7 months 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

  Changed 7 months 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 7 months ago by pfein@…

ouput of python -v

Changed 7 months ago by pfein@…

Changed 7 months ago by pfein@…

Changed 7 months ago by pfein@…

  Changed 7 months 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.

follow-up: ↓ 8   Changed 7 months 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

in reply to: ↑ 7   Changed 7 months 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

  Changed 7 months 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 7 months ago by pfein@…

setup.py to link against apple's sqlite

  Changed 7 months ago by dan.callahan@…

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

follow-up: ↓ 12   Changed 6 months 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.

in reply to: ↑ 11   Changed 5 months 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. ;-)

Note: See TracTickets for help on using tickets.