Need to work with psycopg2ct to get going on PyPy

Bug #944770 reported by Jamu Kakar
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Storm
New
Undecided
Unassigned

Bug Description

I tried to get Storm working with PyPy and psycopg2ct but ended up
running into issues because we reach into psycopg2._psycopg in various
places and this doesn't exist in psycopg2ct.

Revision history for this message
Gavin Panella (allenap) wrote :

I can see this happening in a couple of places:

storm/databases/postgres.py:

> if psycopg2 is not dummy:
> psycopg2.extensions.register_type(psycopg2.extensions.UNICODE)
> psycopg2.extensions.register_type(psycopg2._psycopg.UNICODEARRAY)

tests/databases/postgres.py:

> if has_psycopg:
> import psycopg2._psycopg
> psycopg2_version = psycopg2._psycopg.__version__.split(None, 1)[0]
> if psycopg2_version in ("2.4", "2.4.1", "2.4.2"):
> test_pgbouncer_stopped.skip = (
> "Fails with pyscopg2 %s; see https://bugs.launchpad"

In both case these tricks are no longer necessary, with psycopg2 2.4.4
on Precise at least:

- The UNICODEARRAY type is now in psycopg2.extensions.

- psycopg2.__version__ is now available.

However, I don't know if these changes are reflected in psycopg2ct.

Revision history for this message
Jamu Kakar (jkakar) wrote :

Yeah, I got as far as realizing that psycopg2._psycopg was not defined
in psycopg2ct and then stopped investigating the issue. It looks like
we can't drop support for older versions of psycopg2, since lucid has
a much older version:

$ rmadison psycopg2
  psycopg2 | 2.0.6-3 | hardy/universe | source
  psycopg2 | 2.0.13-2ubuntu2 | lucid | source
  psycopg2 | 2.2.1-1ubuntu1 | maverick | source
  psycopg2 | 2.2.1-1ubuntu2 | natty | source
  psycopg2 | 2.4.2-1 | oneiric | source
  psycopg2 | 2.4.4-3 | precise | source

A good first step would probably be to make the tweaks here dependent
on the version of psycopg2 being used.

Revision history for this message
Gavin Panella (allenap) wrote :

lp:~allenap/storm/psycopg2ct-compat works with psycopg2ct 2.4.4, with the exception of one pgbouncer related test. The compat.register() instructions at http://pypi.python.org/pypi/psycopg2ct must be followed first.

Revision history for this message
Jamu Kakar (jkakar) wrote :

Gavin, you rock! I think we should merge this.

To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.