~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/trace.py

  • Committer: John Arbash Meinel
  • Date: 2006-08-21 18:21:50 UTC
  • mto: This revision was merged to the branch mainline in revision 1953.
  • Revision ID: john@arbash-meinel.com-20060821182150-124585949a9ba684
Fix mutter() so even if args are invalid, it still works

Show diffs side-by-side

added added

removed removed

Lines of Context:
99
99
        # It seems that if we do ascii % (unicode, ascii) we can
100
100
        # get a unicode cannot encode ascii error, so make sure that "fmt"
101
101
        # is a unicode string
102
 
        out = unicode(fmt) % args
 
102
        try:
 
103
            out = unicode(fmt) % args
 
104
        except UnicodeError, e:
 
105
            warning('UnicodeError: %s', e)
 
106
            out_list = [fmt]
 
107
            out_list.extend(args)
 
108
            out = repr(out_list)
103
109
    else:
104
110
        out = fmt
105
111
    out += '\n'