Changeset: fce090da651f for MonetDB
URL: https://dev.monetdb.org/hg/MonetDB/rev/fce090da651f
Modified Files:
        testing/sqllogictest.py
Branch: Aug2024
Log Message:

Work around bug in pymonetdb.
If an error (e.g. timeout) happens during "ON CLIENT" file transfer,
pymonetdb calls the mapi method _sabotage() which sets the socket
attribute to None.  If we then (legitimately) call the close method on
the database handler, we get an AttributeError because the close calls
disconnect which tries to call the socket close method, but socket is
already None.


diffs (15 lines):

diff --git a/testing/sqllogictest.py b/testing/sqllogictest.py
--- a/testing/sqllogictest.py
+++ b/testing/sqllogictest.py
@@ -242,7 +242,10 @@ class SQLLogic:
                 pass
             self.crs = None
         if self.dbh:
-            self.dbh.close()
+            try:
+                self.dbh.close()
+            except AttributeError:
+                pass
             self.dbh = None
 
 
_______________________________________________
checkin-list mailing list -- checkin-list@monetdb.org
To unsubscribe send an email to checkin-list-le...@monetdb.org

Reply via email to