[pypy-dev] when will pypy support psycopg2?

Amaury Forgeot d'Arc amauryfa at gmail.com
Sat Jan 7 15:06:24 CET 2012


2012/1/7 Maciej Fijalkowski <fijall at gmail.com>

> > I am curious that does it hard for pypy to add those data type?
> > like PyByteArray_Type, PyMemoryView_Type and PyInterpreterState
>
> It's usually a painful experience to add new stuff to cpyext. But
> also, it does not necesarilly give you confidence that it'll work,
> since emulating CPython C API is tricky and tiny problems with
> refcounts can lead to segfaults that don't occur on cpython for
> obscure reasons.


I looked at the compilation messages, and added the missing parts;
it was not that difficult, after all :-)

The module should now compile, provided you apply the attached patch to
psycopg.
(I suggested the PyDateTime_DELTA_GET_DAYS macros to CPython:
http://bugs.python.org/issue13727 )

The resulting module works a little... at least it yielded a meaningful
error message:

$ ./pypy-c -c "import psycopg2; conn = psycopg2.connect('dbname=test')"
OperationalError: could not connect to server: No such file or directory
Is the server running locally and accepting
connections on Unix domain socket "/var/run/postgresql/.s.PGSQL.5432"?

-- 
Amaury Forgeot d'Arc
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120107/6be2d17c/attachment.html>
-------------- next part --------------
A non-text attachment was scrubbed...
Name: psycopg-pypy.patch
Type: text/x-patch
Size: 1116 bytes
Desc: not available
URL: <http://mail.python.org/pipermail/pypy-dev/attachments/20120107/6be2d17c/attachment.bin>


More information about the pypy-dev mailing list