reminder about python format strings

Martin Pool mbp at sourcefrog.net
Wed Apr 19 04:45:59 BST 2006


Some error messages were coming out strangely because of the bug fixed
by the attached patch; so this is just a reminder that the name of the
field comes after %, not after the type character.

=== modified file 'a/bzrlib/errors.py'
--- a/bzrlib/errors.py	
+++ b/bzrlib/errors.py	
@@ -136,7 +136,7 @@
 
 
 class NoWorkingTree(BzrNewError):
-    """No WorkingTree exists for %s(base)."""
+    """No WorkingTree exists for %(base)s."""
     
     def __init__(self, base):
         BzrNewError.__init__(self)
@@ -144,7 +144,7 @@
 
 
 class NotLocalUrl(BzrNewError):
-    """%s(url) is not a local path."""
+    """%(url)s is not a local path."""
     
     def __init__(self, url):
         BzrNewError.__init__(self)


-- 
Martin




More information about the bazaar mailing list