Below is a snapshot of the error tracing code for a Windows service running python. I am running. It seems to work fine in python 2.7 on windows xp, but python 2.5 runs on a Windows 2003 server on the working computer that I am using. The main error I encountered is the 'error' object has no attribute 'errno'
Am I doing what is fundamentally wrong for python 2.5, which works for 2.7?
Code abbreviation:
try: if s == None: s = self.connect() char = s.recv(1) line += char except socket.timeout: if s != None: s.close() s = None continue except socket.error, socket_error: servicemanager.LogErrorMsg(traceback.format_exc()) if socket_error.errno == errno.ECONNREFUSED: if s != None: s.close() time.sleep(60) s =None continue else: if s != None: s.close() os._exit(-1) else: pass
Error tracking error:
if socket_error.errno == errno.ECONNREFUSED: AttributeError: 'error' object has no attribute 'errno' %2: %3
source share