~bzr-pqm/bzr/bzr.dev

« back to all changes in this revision

Viewing changes to bzrlib/errors.py

  • Committer: Jonathan Riddell
  • Date: 2011-09-07 10:17:23 UTC
  • mto: (6123.1.10 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6124.
  • Revision ID: jriddell@canonical.com-20110907101723-ybm7048e8lde19lx
resolve that _fmt strings should be ascii so no longer allow for unicode prior to gettext()

Show diffs side-by-side

added added

removed removed

Lines of Context:
144
144
        fmt = getattr(self, '_fmt', None)
145
145
        if fmt is not None:
146
146
            i18n.install()
147
 
            unicode_fmt = osutils.safe_unicode(fmt)
 
147
            unicode_fmt = unicode(fmt) #_fmt strings should be ascii
148
148
            if type(fmt) == unicode:
149
149
                trace.mutter("Unicode strings in error.fmt are deprecated")
150
 
            return gettext(unicode_fmt).encode('utf-8')
 
150
            return gettext(unicode_fmt)
151
151
        fmt = getattr(self, '__doc__', None)
152
152
        if fmt is not None:
153
153
            symbol_versioning.warn("%s uses its docstring as a format, "
2799
2799
    _fmt = "Container has multiple records with the same name: %(name)s"
2800
2800
 
2801
2801
    def __init__(self, name):
2802
 
        self.name = name
 
2802
        self.name = name.decode("utf-8")
2803
2803
 
2804
2804
 
2805
2805
class NoDestinationAddress(InternalBzrError):