Skip to content

Commit d0fd369

Browse files
committed
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.
1 parent 89b6394 commit d0fd369

File tree

2 files changed

+16
-8
lines changed

2 files changed

+16
-8
lines changed

.travis.yml

Lines changed: 9 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -2,10 +2,11 @@ language: python
22

33
python:
44
- 2.7
5-
- 3.4
6-
- 3.5
7-
- 3.6
8-
- 3.7
5+
#test# - 3.4
6+
#test# - 3.5
7+
#test# - 3.6
8+
#test# - 3.7
9+
#test# - nightly
910

1011
#I would like to build and test the maint-1.6 and trunk/default
1112
#but we need different environments for these:
@@ -20,8 +21,8 @@ dist:
2021
- xenial
2122

2223
matrix:
23-
allow_failures: # 3.7 not ready for prime time yet.
24-
- python: 3.7
24+
allow_failures: # nightly not ready for prime time yet.
25+
- nightly
2526

2627
sudo: false
2728

@@ -83,8 +84,8 @@ before_install:
8384
- cd $TRAVIS_BUILD_DIR
8485

8586
install:
86-
- pip install mysqlclient==1.3.13
87-
#- pip install mysqlclient
87+
#test# - pip install mysqlclient==1.3.13
88+
- pip install mysqlclient
8889
- pip install psycopg2
8990
- pip install gpg pytz whoosh pyjwt
9091
- pip install pytest-cov codecov

roundup/backends/back_mysql.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -587,6 +587,13 @@ def sql_close(self):
587587
self.log_info('close')
588588
try:
589589
self.conn.close()
590+
# issue2551025: with revision 1.3.14 of mysqlclient.
591+
# It looks like you can get an OperationalError 2006
592+
# raised for closing a closed handle.
593+
except MySQLdb.OperationalError as message:
594+
print str(message)
595+
if str(message) != '':
596+
raise
590597
except MySQLdb.ProgrammingError as message:
591598
if str(message) != 'closing a closed connection':
592599
raise

0 commit comments

Comments
 (0)