Roundup Tracker - Issues

Message7670

Author rouilj
Recipients rouilj, schlatterbeck
Date 2022-11-24.01:57:08
Message-id <1669255029.16.0.384338663827.issue2551241@roundup.psfhosted.org>
In-reply-to
I can reproduce this on issue.roundup-tracker.org that has an older psycopg2.

 from psycopg2 import InFailedSqlTransaction, SyntaxError, \
                                UndefinedObject

doesn't work.

https://www.psycopg.org/docs/errors.html maps the 2.8+ exceptions
to their base exceptions. So we can use the base exceptions instead.

  from psycopg2 import InternalError as InFailedSqlTransaction, \
                       ProgrammingError as SyntaxError
  UndefinedObject = SyntaxError

>>> from psycopg2 import InternalError as InFailedSqlTransaction, \
...                        ProgrammingError as SyntaxError
>>> UndefinedObject = SyntaxError
>>> UndefinedObject
<class 'psycopg2.ProgrammingError'>
>>> SyntaxError
<class 'psycopg2.ProgrammingError'>
>>> InFailedSqlTransaction
<class 'psycopg2.InternalError'>

I think that will do. It's not as targeted as the original errors, but
should do the trick with the older psycopg2.

Ralf, can you try patching the except clause with the above import and assignment?
Then run the test suite to see if it fixes the issue.

Surprisingly, the SyntaxError and UndefinedObject error seem to be raised
by the test suite according to:

  https://app.codecov.io/gh/roundup-
tracker/roundup/blob/master/roundup/backends/indexer_postgresql_fts.py

So if this isn't the right thing to do, hopefully some test will fail.

InFailedSqlTransaction isn't raised by tests so that might still be an issue.
But if the other two pass it gives me hope that this is correct too.
History
Date User Action Args
2022-11-24 01:57:09rouiljsetmessageid: <1669255029.16.0.384338663827.issue2551241@roundup.psfhosted.org>
2022-11-24 01:57:09rouiljsetrecipients: + rouilj, schlatterbeck
2022-11-24 01:57:09rouiljlinkissue2551241 messages
2022-11-24 01:57:08rouiljcreate