Changeset 2523 for pykota

Show
Ignore:
Timestamp:
09/29/05 10:44:49 (19 years ago)
Author:
jerome
Message:

Fixed a debug message problem in the case of a socket error

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • pykota/trunk/pykota/accounters/pjl.py

    r2506 r2523  
    7878            sock.connect((self.printerHostname, self.port)) 
    7979        except socket.error, msg : 
    80             self.parent.filter.printInfo(_("Problem during connection to %s:%s : %s") % (self.printerHostname, self.port, msg), "warn") 
     80            self.parent.filter.printInfo(_("Problem during connection to %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn") 
    8181        else : 
    8282            self.parent.filter.logdebug("Connected to printer %s" % self.printerHostname) 
     
    8484                sock.send(pjlMessage) 
    8585            except socket.error, msg : 
    86                 self.parent.filter.printInfo(_("Problem while sending PJL query to %s:%s : %s") % (self.printerHostname, self.port, msg), "warn") 
     86                self.parent.filter.printInfo(_("Problem while sending PJL query to %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn") 
    8787            else :     
    8888                self.parent.filter.logdebug("Query sent to %s : %s" % (self.printerHostname, repr(pjlMessage))) 
     
    9797                        self.parent.filter.logdebug("I/O Error [%s] : alarm handler probably called" % msg) 
    9898                        break   # our alarm handler was launched, probably 
    99                     except socket.error :     
    100                         self.parent.filter.printInfo(_("Problem while receiving PJL answer from %s:%s : %s") % (self.printerHostname, self.port, msg), "warn") 
     99                    except socket.error, msg : 
     100                        self.parent.filter.printInfo(_("Problem while receiving PJL answer from %s:%s : %s") % (self.printerHostname, self.port, str(msg)), "warn") 
    101101                    else :     
    102102                        readnext = 0