ProgramingError on empty result set

Hrvoje Niksic <[email protected]>
Newsgroups gmane.comp.python.sybase
Message-ID <[email protected]>
I'm using python-sybase with MS SQL 6.5 and FreeTDS 0.61.  I keep 
stumbling upon this:

 >>> import Sybase
 >>> conn=Sybase.connect(...)
 >>> c=conn.cursor()
 >>> c.execute("select * from customer where name='nosuchname'")
 >>> c.fetchall()
Traceback (most recent call last):
   File "<stdin>", line 1, in ?
   File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 733, in 
fetchall
     return self._fetcher.fetchall()
   File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 517, in 
fetchall
     row = self.fetchone()
   File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 448, in 
fetchone
     self._raise_error(ProgrammingError, 'no result set pending')
   File "/usr/local/lib/python2.2/site-packages/Sybase.py", line 432, in 
_raise_error
     raise exc(text)
Sybase.ProgrammingError: no result set pending
 >>>

Shouldn't fetchall() simply return an empty list when no results are 
available?
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.