Mercurial > p > roundup > code
diff roundup/backends/back_mysql.py @ 5917:3a6114d377f4
issue2551025: try handling operational error exception in close
The sql_close function already ignores closed connection errors when
raised by ProgrammingError. Trying to add similar for OperatonalError.
But need to know what message is being returned.
Changed travis config to:
1) make failure on python-3.7 raise a ci failure.
2) try to add support for python nightly
3) only run python-2.7 for diagnostic purpose so less waiting.
| author | John Rouillard <rouilj@ieee.org> |
|---|---|
| date | Sun, 13 Oct 2019 13:16:17 -0400 |
| parents | ee2e8f8d6648 |
| children | 10fb641f5152 |
line wrap: on
line diff
--- a/roundup/backends/back_mysql.py Sat Oct 12 21:40:18 2019 -0400 +++ b/roundup/backends/back_mysql.py Sun Oct 13 13:16:17 2019 -0400 @@ -587,6 +587,13 @@ self.log_info('close') try: self.conn.close() + # issue2551025: with revision 1.3.14 of mysqlclient. + # It looks like you can get an OperationalError 2006 + # raised for closing a closed handle. + except MySQLdb.OperationalError as message: + print str(message) + if str(message) != '': + raise except MySQLdb.ProgrammingError as message: if str(message) != 'closing a closed connection': raise
