python IOError exception
<p>I am getting the following exception in my python script.The script is running 24*7 and it throws the below exception every two hours.Any thoughts on when this exception happen will be useful.</p>

<pre><code>    Traceback (most recent call last):
    File "ApprovedLeadTracker.py", line 337, in ?
    processSendMailTo(sendMailTo,dedup_leads,icenet_leads,dedup_leads_tot)
    File "ApprovedLeadTracker.py", line 274, in processSendMailTo
    ue_db.processQuery(q=query)
    File "/public/gdp/trunk/src/ukl/python/database.py", line 63, in processQuery
    print traceback.format_exc()
    IOError: [Errno 5] Input/output error
</code></pre>

<p>database.py</p>

<pre><code>def processQuery(self, q, locals=None, returnLastRowId = False, opt=''):
        ret = None
        err = ''
        for i in range(2):
            try:
                cursor = self.getCursor(opt)
                cursor.execute(q,locals)
                if (returnLastRowId):
                    ret = cursor.lastrowid
                else:
                    ret = cursor.fetchall()
                cursor.close()
                #q = cursor._last_executed
                #self.log('SUCCESS',q)
                return ret
            except MySQLdb.OperationalError, e:
                print "Exception Query:", q
                print "Exception:", e
                err = e
                print traceback.format_exc()
                self.conn = self.connect()
            except Exception, e:
                print "Exception Query:", q
                print "Exception:", e
                err = e
                print traceback.format_exc()
                self.conn = self.connect()
                break
        #q = cursor._last_executed
        #self.log('FAILURE',q)
        raise RuntimeError, str(err)
</code></pre>
