1. This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.
  2. Anuncie Aqui
    Anuncie aqui você Também: fdantas@4each.com.br

[Python] python IOError exception

Discussão em 'Python' iniciado por Stack, Fevereiro 6, 2025.

  1. Stack

    Stack Membro Participativo

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

    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


    database.py

    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)

    Continue reading...

Compartilhe esta Página