~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 14:20:10 UTC
  • mfrom: (6123.1.10 +trunk)
  • mto: (6123.1.12 +trunk)
  • mto: This revision was merged to the branch mainline in revision 6124.
  • Revision ID: jriddell@canonical.com-20110907142010-kncwzcbpsxd714ug
mergeĀ inĀ trunk

Show diffs side-by-side

added added

removed removed

Lines of Context:
21
21
    osutils,
22
22
    symbol_versioning,
23
23
    i18n,
 
24
    trace,
24
25
    )
25
26
from bzrlib.i18n import gettext
26
27
from bzrlib.patches import (
143
144
        fmt = getattr(self, '_fmt', None)
144
145
        if fmt is not None:
145
146
            i18n.install()
146
 
            return gettext(fmt)
 
147
            unicode_fmt = unicode(fmt) #_fmt strings should be ascii
 
148
            if type(fmt) == unicode:
 
149
                trace.mutter("Unicode strings in error.fmt are deprecated")
 
150
            return gettext(unicode_fmt)
147
151
        fmt = getattr(self, '__doc__', None)
148
152
        if fmt is not None:
149
153
            symbol_versioning.warn("%s uses its docstring as a format, "
2352
2356
    """
2353
2357
 
2354
2358
 
 
2359
class GhostTagsNotSupported(BzrError):
 
2360
 
 
2361
    _fmt = "Ghost tags not supported by format %(format)r."
 
2362
 
 
2363
    def __init__(self, format):
 
2364
        self.format = format
 
2365
 
 
2366
 
2355
2367
class BinaryFile(BzrError):
2356
2368
 
2357
2369
    _fmt = "File is binary but should be text."
2787
2799
    _fmt = "Container has multiple records with the same name: %(name)s"
2788
2800
 
2789
2801
    def __init__(self, name):
2790
 
        self.name = name
 
2802
        self.name = name.decode("utf-8")
2791
2803
 
2792
2804
 
2793
2805
class NoDestinationAddress(InternalBzrError):