Ignore:
Timestamp:
12/27/12 08:04:59 (11 years ago)
Author:
István Váradi <ivaradi@…>
Branch:
default
hg-Phase:
(<MercurialRepository 1 'hg:/home/ivaradi/mlx/hg' '/'>, 'public')
Message:

The exception strings are converted from UTF-8 to unicode for proper logging (re #170)

File:
1 edited

Legend:

Unmodified
Added
Removed
  • src/mlx/fsuipc.py

    r394 r401  
    104104            return fun()
    105105        except Exception, e:
    106             print >> sys.stderr, str(e)
     106            print >> sys.stderr, util.utf2unicode(str(e))
    107107            return None
    108108
     
    386386                return attempts
    387387            except Exception, e:
    388                 print "fsuipc.Handler._connect: connection failed: " + str(e) + \
     388                print "fsuipc.Handler._connect: connection failed: " + \
     389                      util.utf2unicode(str(e)) + \
    389390                      " (attempts: %d)" % (attempts,)
    390391                if attempts<self.NUM_CONNECTATTEMPTS:
     
    446447            except Exception as e:
    447448                print "fsuipc.Handler._processRequest: FSUIPC connection failed (" + \
    448                       str(e) + "), reconnecting (attempts=%d)." % (attempts,)
     449                      util.utf2unicode(str(e)) + \
     450                      "), reconnecting (attempts=%d)." % (attempts,)
    449451                needReconnect = True
    450452
     
    895897
    896898        Return if a new model was created."""
     899        name = self._latin1decoder(name)[0]
     900        airPath = self._latin1decoder(airPath)[0]
     901
    897902        aircraftName = (name, airPath)
    898903        if aircraftName==self._aircraftName:
     
    912917
    913918        if needNew:
    914             self._setAircraftModel(AircraftModel.create(self._aircraft, aircraftName))
    915 
    916 
    917         self._aircraft.modelChanged(timestamp, self._latin1decoder(name)[0],
    918                                     self._aircraftModel.name)
     919            self._setAircraftModel(AircraftModel.create(self._aircraft,
     920                                                        aircraftName))
     921
     922        self._aircraft.modelChanged(timestamp, name, self._aircraftModel.name)
    919923
    920924        return needNew
Note: See TracChangeset for help on using the changeset viewer.