python-pgsql - stacktrace when using arrays

Bug #177268 reported by Guillaume Pratte
8
Affects Status Importance Assigned to Milestone
python-pgsql (Ubuntu)
Fix Released
Medium
Luca Falavigna

Bug Description

Binary package hint: python-pgsql

The following code causes a stacktrace in python-pgsql :

------
import PgSQL
conn = PgSQL.connect(user="user",password="pass",database="db",host="host")
cur.execute("SELECT ARRAY[now()]")
res = cur.fetchall()
------

Here is the stacktrace (test.py is the test file containing the above code):

------
Traceback (most recent call last):
  File "/usr/lib/python2.5/site-packages/pyPgSQL/test.py", line 5, in <module>
    res = cur.fetchall()
  File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 3247, in fetchall
    _list.append(self.__fetchOneRow())
  File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 2814, in __fetchOneRow
    _r.getvalue(self._idx_, _i)))
  File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 890, in typecast
    return self.handleArray(colinfo, _list)
  File "/usr/lib/python2.5/site-packages/pyPgSQL/PgSQL.py", line 999, in handleArray
    if _fvt != PG_INTERVAL:
NameError: global name '_fvt' is not defined
------

This bug is present in edgy, feisty and gutsy, but not in dapper. It was not tested in hardy.

We can conclude the following :
* the bug appeared in version 2.5.1 (since edgy)
* the bug is not caused from the upgrade of python 2.4 to python 2.5 (since the bug is in edgy, which uses python 2.4)

This bug is pretty strange, since '_fvt' seems to be used in the live above the error (line 998).

Related branches

Revision history for this message
Luca Falavigna (dktrkranz) wrote :
Changed in python-pgsql:
assignee: nobody → dktrkranz
importance: Undecided → Medium
status: New → In Progress
Revision history for this message
Luca Falavigna (dktrkranz) wrote :

python-pgsql (2.5.1-2ubuntu1) hardy; urgency=low

  * pyPgSQL/PgSQL.py: fix typo which caused NameError (LP: #177268)
  * debian/control: update Maintainer field as per spec

 -- Luca Falavigna <email address hidden> Wed, 19 Dec 2007 15:28:04 +0100

Changed in python-pgsql:
status: In Progress → Fix Released
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.