changeset 969:5bf6d7a2ffcf

Convert all %r, %s, %x, %d, %i, %o to new Format String Syntax
author Vedran Mileti? <rivanvx@gmail.com>
date Sun, 16 Oct 2011 02:26:35 +0200
parents 26bd2c7936f9
children de23e50d1801
files MoinMoin/__init__.py MoinMoin/_tests/__init__.py MoinMoin/_tests/ldap_testbase.py MoinMoin/_tests/ldap_testdata.py MoinMoin/_tests/test_sourcecode.py MoinMoin/_tests/test_user.py MoinMoin/apps/admin/views.py MoinMoin/apps/feed/views.py MoinMoin/apps/frontend/views.py MoinMoin/auth/__init__.py MoinMoin/auth/_tests/test_ldap_login.py MoinMoin/auth/http.py MoinMoin/auth/ldap_login.py MoinMoin/auth/log.py MoinMoin/auth/openidrp.py MoinMoin/auth/smb_mount.py MoinMoin/config/_tests/test_defaultconfig.py MoinMoin/config/default.py MoinMoin/constants/tools/chartypes_create.py MoinMoin/converter/__init__.py MoinMoin/converter/_args.py MoinMoin/converter/_tests/test_docbook_in.py MoinMoin/converter/_tests/test_docbook_out.py MoinMoin/converter/_tests/test_html_in.py MoinMoin/converter/_tests/test_html_in_out.py MoinMoin/converter/_tests/test_html_out.py MoinMoin/converter/_tests/test_moinwiki_in_out.py MoinMoin/converter/_tests/test_moinwiki_out.py MoinMoin/converter/_tests/test_rst_out.py MoinMoin/converter/_util.py MoinMoin/converter/_wiki_macro.py MoinMoin/converter/archive_in.py MoinMoin/converter/audio_video_in.py MoinMoin/converter/creole_in.py MoinMoin/converter/docbook_in.py MoinMoin/converter/docbook_out.py MoinMoin/converter/everything.py MoinMoin/converter/html_in.py MoinMoin/converter/html_out.py MoinMoin/converter/image_in.py MoinMoin/converter/include.py MoinMoin/converter/link.py MoinMoin/converter/macro.py MoinMoin/converter/mediawiki_in.py MoinMoin/converter/moinwiki_in.py MoinMoin/converter/moinwiki_out.py MoinMoin/converter/pygments_in.py MoinMoin/converter/rst_in.py MoinMoin/converter/rst_out.py MoinMoin/datastruct/backends/__init__.py MoinMoin/datastruct/backends/_tests/__init__.py MoinMoin/datastruct/backends/composite_dicts.py MoinMoin/datastruct/backends/composite_groups.py MoinMoin/i18n/__init__.py MoinMoin/items/__init__.py MoinMoin/log.py MoinMoin/macro/Date.py MoinMoin/macro/MailTo.py MoinMoin/macro/PagenameList.py MoinMoin/macro/_base.py MoinMoin/mail/sendmail.py MoinMoin/script/account/disable.py MoinMoin/script/account/resetpw.py MoinMoin/script/maint/index.py MoinMoin/script/maint/reduce_revisions.py MoinMoin/script/maint/set_meta.py MoinMoin/script/migration/moin19/_logfile19.py MoinMoin/script/migration/moin19/_utils19.py MoinMoin/script/migration/moin19/import19.py MoinMoin/search/analyzers.py MoinMoin/security/_tests/test_security.py MoinMoin/security/textcha.py MoinMoin/security/ticket.py MoinMoin/signalling/log.py MoinMoin/storage/__init__.py MoinMoin/storage/backends/fileserver.py MoinMoin/storage/backends/stores.py MoinMoin/storage/middleware/_tests/test_indexing.py MoinMoin/storage/middleware/indexing.py MoinMoin/storage/middleware/protecting.py MoinMoin/storage/middleware/routing.py MoinMoin/storage/stores/_tests/conftest.py MoinMoin/storage/stores/_tests/test_sqla.py MoinMoin/storage/stores/kt.py MoinMoin/storage/stores/sqlite.py MoinMoin/themes/__init__.py MoinMoin/user.py MoinMoin/util/_tests/test_iri.py MoinMoin/util/_tests/test_pysupport.py MoinMoin/util/clock.py MoinMoin/util/crypto.py MoinMoin/util/diff_html.py MoinMoin/util/diff_text.py MoinMoin/util/filesys.py MoinMoin/util/interwiki.py MoinMoin/util/iri.py MoinMoin/util/lock.py MoinMoin/util/mime.py MoinMoin/util/mimetype.py MoinMoin/util/monkeypatch.py MoinMoin/util/paramparser.py MoinMoin/util/plugins.py MoinMoin/util/profile.py MoinMoin/util/pysupport.py MoinMoin/util/registry.py MoinMoin/util/send_file.py MoinMoin/util/thread_monitor.py MoinMoin/util/tree.py MoinMoin/util/version.py MoinMoin/wikiutil.py
diffstat 110 files changed, 472 insertions(+), 522 deletions(-) [+]
line wrap: on
line diff
--- a/MoinMoin/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -13,7 +13,7 @@
 
 import sys
 if sys.hexversion < 0x2060000:
-    sys.exit("%s requires Python 2.6 or greater.\n" % project)
+    sys.exit("{0} requires Python 2.6 or greater.\n".format(project))
 
 
 from MoinMoin.util.version import Version
--- a/MoinMoin/_tests/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/_tests/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -63,7 +63,7 @@
 def create_random_string_list(length=14, count=10):
     """ creates a list of random strings """
     chars = 'abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ'
-    return [u"%s" % random_string(length, chars) for counter in range(count)]
+    return [u"{0}".format(random_string(length, chars)) for counter in range(count)]
 
 def nuke_item(name):
     """ complete destroys an item """
@@ -82,6 +82,6 @@
         s.shutdown(socket.SHUT_RDWR)
         s.close()
     except socket.error as err:
-        raise Exception("connecting to %s:%d, error: %s" % (host, port, str(err)))
+        raise Exception("connecting to {0}:{1:d}, error: {2!s}".format(host, port, err))
 
 
--- a/MoinMoin/_tests/ldap_testbase.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/_tests/ldap_testbase.py	Sun Oct 16 02:26:35 2011 +0200
@@ -71,7 +71,7 @@
                 (err.errno == 3 and os.name == 'nt')):
             raise
     if not slapd:
-        return "Can't start %s (see SLAPD_EXECUTABLE)." % SLAPD_EXECUTABLE
+        return "Can't start {0} (see SLAPD_EXECUTABLE).".format(SLAPD_EXECUTABLE)
     return None
 
 
@@ -90,9 +90,9 @@
         self.proto = proto
         self.ip = ip
         self.port = port
-        self.url = '%s://%s:%d' % (proto, ip, port) # can be used for ldap.initialize() call
+        self.url = '{0}://{1}:{2}'.format(proto, ip, port) # can be used for ldap.initialize() call
         if service_name == '':
-            self.service_name = '%s:%d' % (executable, port)
+            self.service_name = '{0}:{1}'.format(executable, port)
         else:
             self.service_name = service_name
 
@@ -170,7 +170,7 @@
             DB_CONFIG there.
         """
         # create directories
-        self.ldap_dir = tempfile.mkdtemp(prefix='LdapEnvironment-%d.' % self.instance)
+        self.ldap_dir = tempfile.mkdtemp(prefix='LdapEnvironment-{0}.'.format(self.instance))
         self.ldap_db_dir = os.path.join(self.ldap_dir, 'db')
         os.mkdir(self.ldap_db_dir)
 
@@ -247,8 +247,8 @@
             self.ldap_env.create_env(slapd_config=self.slapd_config)
             started = self.ldap_env.start_slapd()
             if not started:
-                pytest.skip("Failed to start %s process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it)." % SLAPD_EXECUTABLE)
+                pytest.skip("Failed to start {0} process, please see your syslog / log files"
+                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             self.ldap_env.load_directory(ldif_content=self.ldif_content)
 
         def teardown_class(self):
--- a/MoinMoin/_tests/ldap_testdata.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/_tests/ldap_testdata.py	Sun Oct 16 02:26:35 2011 +0200
@@ -7,7 +7,7 @@
 
 
 BASEDN = "ou=testing,dc=example,dc=org"
-ROOTDN = "cn=root,%s" % BASEDN
+ROOTDN = "cn=root,{0}".format(BASEDN)
 ROOTPW = "secret"
 
 SLAPD_CONFIG = """\
--- a/MoinMoin/_tests/test_sourcecode.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/_tests/test_sourcecode.py	Sun Oct 16 02:26:35 2011 +0200
@@ -33,7 +33,7 @@
     def mark_file_ok(path, mtime):
         x = xattr.xattr(path)
         try:
-            x.set('user.moin-pep8-tested-mtime', '%d' % mtime)
+            x.set('user.moin-pep8-tested-mtime', str(int(mtime)))
         except IOError:
             # probably not supported
             global mark_file_ok
--- a/MoinMoin/_tests/test_user.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/_tests/test_user.py	Sun Oct 16 02:26:35 2011 +0200
@@ -24,7 +24,7 @@
         email = u"foo@example.org"
         # first create a user
         ret = user.create_user(name, password, email, validate=False)
-        assert ret is None, "create_user returned: %s" % ret
+        assert ret is None, "create_user returned: {0}".format(ret)
         # now try to use it
         u = user.User(name=name, password=password)
         assert u.name == name
@@ -384,7 +384,7 @@
 
     def createUser(self, name, password, pwencoded=False, email=None, validate=False):
         ret = user.create_user(name, password, email, validate=validate, is_encrypted=pwencoded)
-        assert ret is None, "create_user returned: %s" % ret
+        assert ret is None, "create_user returned: {0}".format(ret)
 
 
 class TestGroupName(object):
@@ -403,9 +403,9 @@
         : and , used in acl rules, we might add more characters to the syntax.
         """
         invalid = u'! # $ % ^ & * ( ) = + , : ; " | ~ / \\ \u0000 \u202a'.split()
-        base = u'User%sName'
+        base = u'User{0}Name'
         for c in invalid:
-            name = base % c
+            name = base.format(c)
             assert not user.isValidName(name)
 
     def testWhitespace(self):
--- a/MoinMoin/apps/admin/views.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/apps/admin/views.py	Sun Oct 16 02:26:35 2011 +0200
@@ -77,9 +77,9 @@
         if ok:
             setattr(u, key, val)
             u.save()
-            flash('%s.%s: %s -> %s' % (user_name, key, unicode(oldval), unicode(val), ), "info")
+            flash('{0}.{1}: {2} -> {3}'.format(user_name, key, unicode(oldval), unicode(val), ), "info")
         else:
-            flash('modifying %s.%s failed' % (user_name, key, ), "error")
+            flash('modifying {0}.{1} failed'.format(user_name, key, ), "error")
     return redirect(url_for('.userbrowser'))
 
 
@@ -167,7 +167,7 @@
         if isinstance(default, defaultconfig.DefaultExpression):
             default_txt = default.text
         else:
-            default_txt = '%r' % (default, )
+            default_txt = repr(default)
             if len(default_txt) > 30:
                 default_txt = '...'
         return default_txt
--- a/MoinMoin/apps/feed/views.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/apps/feed/views.py	Sun Oct 16 02:26:35 2011 +0200
@@ -61,7 +61,7 @@
                     # simple text diff for changes
                     previous_rev = item[previous_revid]
                     content = hl_item._render_data_diff_text(previous_rev.data, this_rev.data)
-                    content = '<div><pre>%s</pre></div>' % content
+                    content = '<div><pre>{0}</pre></div>'.format(content)
                 else:
                     # full html rendering for new items
                     content = hl_item._render_data()
--- a/MoinMoin/apps/frontend/views.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/apps/frontend/views.py	Sun Oct 16 02:26:35 2011 +0200
@@ -1458,10 +1458,10 @@
     keys = sorted(matches.keys())
     # TODO later we could add titles for the misc ranks:
     # 8 item_name
-    # 4 "%s/..." % item_name
-    # 3 "%s...%s" % (start, end)
-    # 1 "%s..." % (start, )
-    # 2 "...%s" % (end, )
+    # 4 "{0}/...".format(item_name)
+    # 3 "{0}...{1}".format(start, end)
+    # 1 "{0}...".format(start)
+    # 2 "...{1}".format(end)
     item_names = []
     for wanted_rank in [8, 4, 3, 1, 2, ]:
         for name in keys:
@@ -1522,11 +1522,11 @@
     :returns: start, end, matches dict
     """
     if start_re is None:
-        start_re = re.compile('([%s][%s]+)' % (config.chars_upper,
-                                               config.chars_lower))
+        start_re = re.compile('([{0}][{1}]+)'.format(config.chars_upper,
+                                                     config.chars_lower))
     if end_re is None:
-        end_re = re.compile('([%s][%s]+)$' % (config.chars_upper,
-                                              config.chars_lower))
+        end_re = re.compile('([{0}][{1}]+)$'.format(config.chars_upper,
+                                                    config.chars_lower))
 
     # If we don't get results with wiki words matching, fall back to
     # simple first word and last word, using spaces.
@@ -1653,7 +1653,7 @@
     tags_counts = {}
     for rev in revs:
         tags = rev.meta.get(TAGS, [])
-        logging.debug("name %s rev %s tags %s" % (rev.meta[NAME], rev.meta[REVID], tags))
+        logging.debug("name {0} rev {1} tags {2}".format(rev.meta[NAME], rev.meta[REVID], tags))
         for tag in tags:
             tags_counts[tag] = tags_counts.setdefault(tag, 0) + 1
     tags_counts = sorted(tags_counts.items())
@@ -1670,7 +1670,7 @@
         def cls(count):
             # return the css class for this tag
             weight = scale * (count - count_min)
-            return "weight%d" % int(weight)  # weight0, ..., weight9
+            return "weight{0}".format(int(weight)) # weight0, ..., weight9
         tags = [(cls(count), tag) for tag, count in tags_counts]
     else:
         tags = []
--- a/MoinMoin/auth/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -163,7 +163,7 @@
 
     # the url should be absolute so we use _external
     url = url_for('frontend.login', login_submit='1', stage=auth_name, _external=True, **extra_fields)
-    logging.debug("multistage_continuation_url: %s" % url)
+    logging.debug("multistage_continuation_url: {0}".format(url))
     return url
 
 
@@ -210,7 +210,7 @@
         return user_obj, True
     def logout(self, user_obj, **kw):
         if self.name and user_obj and user_obj.auth_method == self.name:
-            logging.debug("%s: logout - invalidating user %r" % (self.name, user_obj.name))
+            logging.debug("{0}: logout - invalidating user {1!r}".format(self.name, user_obj.name))
             user_obj.valid = False
         return user_obj, True
     def login_hint(self):
@@ -236,17 +236,17 @@
         if not username and not password:
             return ContinueLogin(user_obj)
 
-        logging.debug("%s: performing login action" % self.name)
+        logging.debug("{0}: performing login action".format(self.name))
 
         if username and not password:
             return ContinueLogin(user_obj, _('Missing password. Please enter user name and password.'))
 
         u = user.User(name=username, password=password, auth_method=self.name)
         if u.valid:
-            logging.debug("%s: successfully authenticated user %r (valid)" % (self.name, u.name))
+            logging.debug("{0}: successfully authenticated user {1!r} (valid)".format(self.name, u.name))
             return ContinueLogin(u)
         else:
-            logging.debug("%s: could not authenticate user %r (not valid)" % (self.name, username))
+            logging.debug("{0}: could not authenticate user {1!r} (not valid)".format(self.name, username))
             return ContinueLogin(user_obj, _("Invalid username or password."))
 
     def login_hint(self):
@@ -335,23 +335,23 @@
         else:
             auth_username = request.environ.get(self.env_var)
 
-        logging.debug("auth_username = %r" % auth_username)
+        logging.debug("auth_username = {0!r}".format(auth_username))
         if auth_username:
             auth_username = self.decode_username(auth_username)
             auth_username = self.transform_username(auth_username)
-            logging.debug("auth_username (after decode/transform) = %r" % auth_username)
+            logging.debug("auth_username (after decode/transform) = {0!r}".format(auth_username))
             u = user.User(auth_username=auth_username,
                           auth_method=self.name, auth_attribs=('name', 'password'))
 
-        logging.debug("u: %r" % u)
+        logging.debug("u: {0!r}".format(u))
         if u and self.autocreate:
             logging.debug("autocreating user")
             u.create_or_update()
         if u and u.valid:
-            logging.debug("returning valid user %r" % u)
+            logging.debug("returning valid user {0!r}".format(u))
             return u, True # True to get other methods called, too
         else:
-            logging.debug("returning %r" % user_obj)
+            logging.debug("returning {0!r}".format(user_obj))
             return user_obj, True
 
 
@@ -430,12 +430,12 @@
         auth_userid = session['user.itemid']
         auth_method = session['user.auth_method']
         auth_attrs = session['user.auth_attribs']
-        logging.debug("got from session: %r %r" % (auth_userid, auth_method))
-        logging.debug("current auth methods: %r" % app.cfg.auth_methods)
+        logging.debug("got from session: {0!r} {1!r}".format(auth_userid, auth_method))
+        logging.debug("current auth methods: {0!r}".format(app.cfg.auth_methods))
         if auth_method and auth_method in app.cfg.auth_methods:
             userobj = user.User(auth_userid,
                                 auth_method=auth_method,
                                 auth_attribs=auth_attrs)
-    logging.debug("session started for user %r", userobj)
+    logging.debug("session started for user {0!r}".format(userobj))
     return userobj
 
--- a/MoinMoin/auth/_tests/test_ldap_login.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/_tests/test_ldap_login.py	Sun Oct 16 02:26:35 2011 +0200
@@ -147,8 +147,8 @@
             ldap_env.create_env(slapd_config=self.slapd_config)
             started = ldap_env.start_slapd()
             if not started:
-                pytest.skip("Failed to start %s process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it)." % SLAPD_EXECUTABLE)
+                pytest.skip("Failed to start {0} process, please see your syslog / log files"
+                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             ldap_env.load_directory(ldif_content=self.ldif_content)
             self.ldap_envs.append(ldap_env)
 
@@ -188,8 +188,8 @@
             ldap_env.create_env(slapd_config=self.slapd_config)
             started = ldap_env.start_slapd()
             if not started:
-                pytest.skip("Failed to start %s process, please see your syslog / log files"
-                             " (and check if stopping apparmor helps, in case you use it)." % SLAPD_EXECUTABLE)
+                pytest.skip("Failed to start {0} process, please see your syslog / log files"
+                             " (and check if stopping apparmor helps, in case you use it).".format(SLAPD_EXECUTABLE))
             ldap_env.load_directory(ldif_content=self.ldif_content)
             self.ldap_envs.append(ldap_env)
 
--- a/MoinMoin/auth/http.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/http.py	Sun Oct 16 02:26:35 2011 +0200
@@ -50,27 +50,26 @@
 
         auth = request.authorization
         if auth and auth.username and auth.password is not None:
-            logging.debug("http basic auth, received username: %r password: %r" % (
-                          auth.username, auth.password))
+            logging.debug("http basic auth, received username: {0!r} password: {1!r}".format(auth.username, auth.password))
             u = user.User(name=auth.username.decode(self.coding),
                           password=auth.password.decode(self.coding),
                           auth_method=self.name, auth_attribs=[])
-            logging.debug("user: %r" % u)
+            logging.debug("user: {0!r}".format(u))
 
         if not u or not u.valid:
             from werkzeug import Response, abort
             response = Response(_('Please log in first.'), 401,
-                                {'WWW-Authenticate': 'Basic realm="%s"' % self.realm})
+                                {'WWW-Authenticate': 'Basic realm="{0}"'.format(self.realm)})
             abort(response)
 
-        logging.debug("u: %r" % u)
+        logging.debug("u: {0!r}".format(u))
         if u and self.autocreate:
             logging.debug("autocreating user")
             u.create_or_update()
         if u and u.valid:
-            logging.debug("returning valid user %r" % u)
+            logging.debug("returning valid user {0!r}".format(u))
             return u, True # True to get other methods called, too
         else:
-            logging.debug("returning %r" % user_obj)
+            logging.debug("returning {0!r}".format(user_obj))
             return user_obj, True
 
--- a/MoinMoin/auth/ldap_login.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/ldap_login.py	Sun Oct 16 02:26:35 2011 +0200
@@ -23,7 +23,7 @@
 try:
     import ldap
 except ImportError as err:
-    logging.error("You need to have python-ldap installed (%s)." % str(err))
+    logging.error("You need to have python-ldap installed ({0!s}).".format(err))
     raise
 
 from MoinMoin import user
@@ -152,28 +152,28 @@
                             ldap.set_option(option, value)
 
                 server = self.server_uri
-                logging.debug("Trying to initialize %r." % server)
+                logging.debug("Trying to initialize {0!r}.".format(server))
                 l = ldap.initialize(server)
-                logging.debug("Connected to LDAP server %r." % server)
+                logging.debug("Connected to LDAP server {0!r}.".format(server))
 
                 if self.start_tls and server.startswith('ldap:'):
-                    logging.debug("Trying to start TLS to %r." % server)
+                    logging.debug("Trying to start TLS to {0!r}.".format(server))
                     try:
                         l.start_tls_s()
-                        logging.debug("Using TLS to %r." % server)
+                        logging.debug("Using TLS to {0!r}.".format(server))
                     except (ldap.SERVER_DOWN, ldap.CONNECT_ERROR) as err:
-                        logging.warning("Couldn't establish TLS to %r (err: %s)." % (server, str(err)))
+                        logging.warning("Couldn't establish TLS to {0!r} (err: {1!s}).".format(server, err))
                         raise
 
                 # you can use %(username)s and %(password)s here to get the stuff entered in the form:
                 binddn = self.bind_dn % locals()
                 bindpw = self.bind_pw % locals()
                 l.simple_bind_s(binddn.encode(coding), bindpw.encode(coding))
-                logging.debug("Bound with binddn %r" % binddn)
+                logging.debug("Bound with binddn {0!r}".format(binddn))
 
                 # you can use %(username)s here to get the stuff entered in the form:
                 filterstr = self.search_filter % locals()
-                logging.debug("Searching %r" % filterstr)
+                logging.debug("Searching {0!r}".format(filterstr))
                 attrs = [getattr(self, attr) for attr in [
                                          'email_attribute',
                                          'aliasname_attribute',
@@ -185,16 +185,16 @@
                 # we remove entries with dn == None to get the real result list:
                 lusers = [(dn, ldap_dict) for dn, ldap_dict in lusers if dn is not None]
                 for dn, ldap_dict in lusers:
-                    logging.debug("dn:%r" % dn)
+                    logging.debug("dn:{0!r}".format(dn))
                     for key, val in ldap_dict.items():
-                        logging.debug("    %r: %r" % (key, val))
+                        logging.debug("    {0!r}: {1!r}".format(key, val))
 
                 result_length = len(lusers)
                 if result_length != 1:
                     if result_length > 1:
-                        logging.warning("Search found more than one (%d) matches for %r." % (result_length, filterstr))
+                        logging.warning("Search found more than one ({0}) matches for {1!r}.".format(result_length, filterstr))
                     if result_length == 0:
-                        logging.debug("Search found no matches for %r." % (filterstr, ))
+                        logging.debug("Search found no matches for {0!r}.".format(filterstr, ))
                     if self.report_invalid_credentials:
                         return ContinueLogin(user_obj, _("Invalid username or password."))
                     else:
@@ -202,9 +202,9 @@
 
                 dn, ldap_dict = lusers[0]
                 if not self.bind_once:
-                    logging.debug("DN found is %r, trying to bind with pw" % dn)
+                    logging.debug("DN found is {0!r}, trying to bind with pw".format(dn))
                     l.simple_bind_s(dn, password.encode(coding))
-                    logging.debug("Bound with dn %r (username: %r)" % (dn, username))
+                    logging.debug("Bound with dn {0!r} (username: {1!r})".format(dn, username))
 
                 if self.email_callback is None:
                     if self.email_attribute:
@@ -223,7 +223,7 @@
                     sn = ldap_dict.get(self.surname_attribute, [''])[0]
                     gn = ldap_dict.get(self.givenname_attribute, [''])[0]
                     if sn and gn:
-                        aliasname = "%s, %s" % (sn, gn)
+                        aliasname = "{0}, {1}".format(sn, gn)
                     elif sn:
                         aliasname = sn
                 aliasname = aliasname.decode(coding)
@@ -238,14 +238,14 @@
                     u = user.User(auth_username=username, auth_method=self.name, auth_attribs=('name', 'password', 'mailto_author', ))
                 u.name = username
                 u.aliasname = aliasname
-                logging.debug("creating user object with name %r email %r alias %r" % (username, email, aliasname))
+                logging.debug("creating user object with name {0!r} email {1!r} alias {2!r}".format(username, email, aliasname))
 
             except ldap.INVALID_CREDENTIALS as err:
-                logging.debug("invalid credentials (wrong password?) for dn %r (username: %r)" % (dn, username))
+                logging.debug("invalid credentials (wrong password?) for dn {0!r} (username: {1!r})".format(dn, username))
                 return CancelLogin(_("Invalid username or password."))
 
             if u and self.autocreate:
-                logging.debug("calling create_or_update to autocreate user %r" % u.name)
+                logging.debug("calling create_or_update to autocreate user {0!r}".format(u.name))
                 u.create_or_update(True)
             return ContinueLogin(u)
 
@@ -254,8 +254,8 @@
             # authenticator object in cfg.auth list (there could be some second
             # ldap authenticator that queries a backup server or any other auth
             # method).
-            logging.error("LDAP server %s failed (%s). "
-                          "Trying to authenticate with next auth list entry." % (server, str(err)))
+            logging.error("LDAP server {0} failed ({1!s}). "
+                          "Trying to authenticate with next auth list entry.".format(server, err))
             return ContinueLogin(user_obj, _("LDAP server %(server)s failed.", server=server))
 
         except:
--- a/MoinMoin/auth/log.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/log.py	Sun Oct 16 02:26:35 2011 +0200
@@ -19,7 +19,7 @@
     name = "log"
 
     def log(self, action, user_obj, kw):
-        logging.info('%s: user_obj=%r kw=%r' % (action, user_obj, kw))
+        logging.info('{0}: user_obj={1!r} kw={2!r}'.format(action, user_obj, kw))
 
     def login(self, user_obj, **kw):
         self.log('login', user_obj, kw)
--- a/MoinMoin/auth/openidrp.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/openidrp.py	Sun Oct 16 02:26:35 2011 +0200
@@ -59,7 +59,7 @@
         if oid_info.status == consumer.FAILURE:
             # verification has failed
             # return an error message with description of error
-            logging.debug("OpenIDError: %s" % oid_info.message)
+            logging.debug("OpenIDError: {0}".format(oid_info.message))
 
             error_message = _('OpenID Error')
             return CancelLogin(error_message)
@@ -70,7 +70,7 @@
             # return error
             return CancelLogin(_('OpenID verification cancelled.'))
         elif oid_info.status == consumer.SUCCESS:
-            logging.debug('OpenID success. id: %s' % oid_info.identity_url)
+            logging.debug('OpenID success. id: {0}'.format(oid_info.identity_url))
 
             # we get the provider's url
             # and the list of trusted providers
--- a/MoinMoin/auth/smb_mount.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/auth/smb_mount.py	Sun Oct 16 02:26:35 2011 +0200
@@ -48,7 +48,7 @@
         self.coding = coding
 
     def do_smb(self, username, password, login):
-        logging.debug("login=%s logout=%s: got name=%s" % (login, not login, username))
+        logging.debug("login={0} logout={1}: got name={2}".format(login, not login, username))
 
         import os, pwd, subprocess
         web_username = self.dir_user
--- a/MoinMoin/config/_tests/test_defaultconfig.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/config/_tests/test_defaultconfig.py	Sun Oct 16 02:26:35 2011 +0200
@@ -23,7 +23,7 @@
         (u'BBBaaaddd', False), # not enough different chars
         (username, False), # username == password
         (username[1:-1], False), # password in username
-        (u"XXX%sXXX" % username, False), # username in password
+        (u"XXX{0}XXX".format(username), False), # username in password
         (u'Moin-2007', True), # this should be OK
     ]
     def testBuiltinPasswordChecker(self):
@@ -33,7 +33,7 @@
         else:
             for pw, result in self.tests_builtin:
                 pw_error = pw_checker(self.username, pw)
-                print "%r: %s" % (pw, pw_error)
+                print "{0!r}: {1}".format(pw, pw_error)
                 assert result == (pw_error is None)
 
 coverage_modules = ['MoinMoin.config.default']
--- a/MoinMoin/config/default.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/config/default.py	Sun Oct 16 02:26:35 2011 +0200
@@ -68,8 +68,8 @@
         self.cache.item_group_regex = re.compile(self.item_group_regex, re.UNICODE)
 
         # the ..._regexact versions only match if nothing is left (exact match)
-        self.cache.item_dict_regexact = re.compile(u'^%s$' % self.item_dict_regex, re.UNICODE)
-        self.cache.item_group_regexact = re.compile(u'^%s$' % self.item_group_regex, re.UNICODE)
+        self.cache.item_dict_regexact = re.compile(u'^{0}$'.format(self.item_dict_regex, re.UNICODE))
+        self.cache.item_group_regexact = re.compile(u'^{0}$'.format(self.item_group_regex, re.UNICODE))
 
         # compiled functions ACL
         self.cache.acl_functions = AccessControlList([self.acl_functions], valid=self.acl_rights_functions)
@@ -133,7 +133,7 @@
         secret_min_length = 10
         if isinstance(self.secrets, str):
             if len(self.secrets) < secret_min_length:
-                raise error.ConfigurationError("The secrets = '...' wiki config setting is a way too short string (minimum length is %d chars)!" % (
+                raise error.ConfigurationError("The secrets = '...' wiki config setting is a way too short string (minimum length is {0} chars)!".format(
                     secret_min_length))
             # for lazy people: set all required secrets to same value
             secrets = {}
@@ -148,7 +148,7 @@
                 if len(secret) < secret_min_length:
                     raise ValueError
             except (KeyError, ValueError):
-                raise error.ConfigurationError("You must set a (at least %d chars long) secret string for secrets['%s']!" % (
+                raise error.ConfigurationError("You must set a (at least {0} chars long) secret string for secrets['{1}']!".format(
                     secret_min_length, secret_key_name))
 
     def _config_check(self):
@@ -160,17 +160,17 @@
         This check is disabled by default, when enabled, it will show an
         error message with unknown names.
         """
-        unknown = ['"%s"' % name for name in dir(self)
+        unknown = ['"{0}"'.format(name) for name in dir(self)
                   if not name.startswith('_') and
                   name not in DefaultConfig.__dict__ and
                   not isinstance(getattr(self, name), (type(sys), type(DefaultConfig)))]
         if unknown:
             msg = """
-Unknown configuration options: %s.
+Unknown configuration options: {0}.
 
 For more information, visit HelpOnConfiguration. Please check your
 configuration for typos before requesting support or reporting a bug.
-""" % ', '.join(unknown)
+""".format(', '.join(unknown))
             raise error.ConfigurationError(msg)
 
     def _decode(self):
--- a/MoinMoin/constants/tools/chartypes_create.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/constants/tools/chartypes_create.py	Sun Oct 16 02:26:35 2011 +0200
@@ -14,7 +14,7 @@
     space = []
     for code in range(1, 65535):
         c = unichr(code)
-        str = "\\u%04x" % code
+        str = "\\u{0:04x}".format(code)
         if c.isupper():
             uppercase.append(str)
         elif c.islower():
--- a/MoinMoin/converter/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -56,7 +56,7 @@
             return NotImplemented
 
         def __repr__(self):
-            return '<%s: input %s, output %s, prio %d [%r]>' % (self.__class__.__name__,
+            return '<{0}: input {1}, output {2}, prio {3} [{4!r}]>' % (self.__class__.__name__,
                     self.type_input,
                     self.type_output,
                     self.priority,
--- a/MoinMoin/converter/_args.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_args.py	Sun Oct 16 02:26:35 2011 +0200
@@ -37,7 +37,7 @@
         return len(self.positional) + len(self.keyword)
 
     def __repr__(self):
-        return '<%s(%r, %r)>' % (self.__class__.__name__,
+        return '<{0}({1!r}, {2!r})>'.format(self.__class__.__name__,
                 self.positional, self.keyword)
 
     def items(self):
--- a/MoinMoin/converter/_tests/test_docbook_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_docbook_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -24,10 +24,7 @@
 from MoinMoin.converter.docbook_in import *
 
 class Base(object):
-    input_namespaces = ns_all = u'xmlns="%s" xmlns:xlink="%s"' % (
-        docbook.namespace,
-        xlink.namespace,
-    )
+    input_namespaces = ns_all = u'xmlns="{0}" xmlns:xlink="{1}"'.format(docbook.namespace, xlink.namespace)
     output_namespaces = {
         moin_page.namespace: u'',
         xlink.namespace: u'xlink',
@@ -58,13 +55,13 @@
 
     def do(self, input, xpath_query):
         string_to_parse = self.handle_output(input)
-        logging.debug(u"After the DOCBOOK_IN conversion : %s" % string_to_parse)
+        logging.debug(u"After the DOCBOOK_IN conversion : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(xpath_query, namespaces=self.namespaces_xpath))
 
     def do_nonamespace(self, input, xpath_query):
         string_to_parse = self.handle_output(input, nonamespace=True)
-        logging.debug(u"After the DOCBOOK_IN conversion : %s" % string_to_parse)
+        logging.debug(u"After the DOCBOOK_IN conversion : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(xpath_query, namespaces=self.namespaces_xpath))
 
--- a/MoinMoin/converter/_tests/test_docbook_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_docbook_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -23,13 +23,7 @@
 from MoinMoin.converter.docbook_out import *
 
 class Base(object):
-    input_namespaces = ns_all = 'xmlns="%s" xmlns:page="%s" xmlns:html="%s" xmlns:xlink="%s" xmlns:xml="%s"' % (
-        moin_page.namespace,
-        moin_page.namespace,
-        html.namespace,
-        xlink.namespace,
-        xml.namespace,
-    )
+    input_namespaces = ns_all = 'xmlns="{0}" xmlns:page="{1}" xmlns:html="{2}" xmlns:xlink="{3}" xmlns:xml="{4}"'.format(moin_page.namespace, moin_page.namespace, html.namespace, xlink.namespace, xml.namespace)
     output_namespaces = {
         docbook.namespace: '',
         moin_page.namespace: 'page',
@@ -57,7 +51,7 @@
     def do(self, input, xpath, args={}):
         out = self.conv(self.handle_input(input), **args)
         string_to_parse = self.handle_output(out)
-        logging.debug("After the docbook_OUT conversion : %s" % string_to_parse)
+        logging.debug("After the docbook_OUT conversion : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(xpath, namespaces=self.namespaces_xpath))
 
--- a/MoinMoin/converter/_tests/test_html_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_html_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -46,7 +46,7 @@
 
     def do(self, input, path):
         string_to_parse = self.handle_input(input, args={})
-        logging.debug("After the HTML_IN conversion : %s" % string_to_parse)
+        logging.debug("After the HTML_IN conversion : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(path, namespaces=self.namespaces_xpath))
 
--- a/MoinMoin/converter/_tests/test_html_in_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_html_in_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -39,8 +39,7 @@
         f = StringIO.StringIO()
         out = self.conv_html_dom(input, **args)
         out.write(f.write, namespaces=self.namespaces, )
-        logging.debug("After the HTML_IN conversion : %s" %
-                      self.output_re.sub(u'', f.getvalue()))
+        logging.debug("After the HTML_IN conversion : {0}".format(self.output_re.sub(u'', f.getvalue())))
         out = self.conv_dom_html(out, **args)
         f = StringIO.StringIO()
         out.write(f.write, namespaces=self.namespaces, )
@@ -48,7 +47,7 @@
 
     def do(self, input, path):
         string_to_parse = self.handle_input(input, args={})
-        logging.debug("After the roundtrip : %s" % string_to_parse)
+        logging.debug("After the roundtrip : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(path))
 
--- a/MoinMoin/converter/_tests/test_html_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_html_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -24,13 +24,7 @@
 from MoinMoin.converter.html_out import *
 
 class Base(object):
-    input_namespaces = ns_all = 'xmlns="%s" xmlns:page="%s" xmlns:html="%s" xmlns:xlink="%s" xmlns:xml="%s"' % (
-        moin_page.namespace,
-        moin_page.namespace,
-        html.namespace,
-        xlink.namespace,
-        xml.namespace,
-    )
+    input_namespaces = ns_all = 'xmlns="{0}" xmlns:page="{1}" xmlns:html="{2}" xmlns:xlink="{3}" xmlns:xml="{4}"'.format(moin_page.namespace, moin_page.namespace, html.namespace, xlink.namespace, xml.namespace)
     output_namespaces = {
         html.namespace: '',
         moin_page.namespace: 'page',
@@ -53,7 +47,7 @@
     def do(self, input, xpath, args={}):
         out = self.conv(self.handle_input(input), **args)
         string_to_parse = self.handle_output(out)
-        logging.debug("After the HTML_OUT conversion : %s" % string_to_parse)
+        logging.debug("After the HTML_OUT conversion : {0}".format(string_to_parse))
         tree = etree.parse(StringIO.StringIO(string_to_parse))
         assert (tree.xpath(xpath))
 
@@ -249,5 +243,5 @@
 
     @pytest.mark.xfail
     def test_unknown(self):
-        page = ET.XML("<page:unknown %s/>" % self.input_namespaces)
+        page = ET.XML("<page:unknown {0}/>".format(self.input_namespaces))
         pytest.raises(ElementException, self.conv.__call__, page)
--- a/MoinMoin/converter/_tests/test_moinwiki_in_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_moinwiki_in_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -22,10 +22,7 @@
 
 class TestConverter(object):
 
-    input_namespaces =  'xmlns="%s" xmlns:page="%s" xmlns:xlink="%s"' % (
-        moin_page.namespace,
-        moin_page.namespace,
-        xlink.namespace)
+    input_namespaces =  'xmlns="{0}" xmlns:page="{1}" xmlns:xlink="{2}"'.format(moin_page.namespace, moin_page.namespace, xlink.namespace)
 
     namespaces = {
         moin_page.namespace: 'page',
--- a/MoinMoin/converter/_tests/test_moinwiki_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_moinwiki_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -14,10 +14,7 @@
 
 
 class Base(object):
-    input_namespaces = ns_all = 'xmlns="%s" xmlns:page="%s" xmlns:xlink="%s"' % (
-        moin_page.namespace,
-        moin_page.namespace,
-        xlink.namespace)
+    input_namespaces = ns_all = 'xmlns="{0}" xmlns:page="{1}" xmlns:xlink="{2}"'.format(moin_page.namespace, moin_page.namespace, xlink.namespace)
     output_namespaces = {
         moin_page.namespace: 'page'
     }
--- a/MoinMoin/converter/_tests/test_rst_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_tests/test_rst_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -13,10 +13,7 @@
 
 
 class Base(object):
-    input_namespaces = ns_all = 'xmlns="%s" xmlns:page="%s" xmlns:xlink="%s"' % (
-        moin_page.namespace,
-        moin_page.namespace,
-        xlink.namespace)
+    input_namespaces = ns_all = 'xmlns="{0}" xmlns:page="{1}" xmlns:xlink="{2}"'.format(moin_page.namespace, moin_page.namespace, xlink.namespace)
     output_namespaces = {
         moin_page.namespace: 'page'
     }
--- a/MoinMoin/converter/_util.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_util.py	Sun Oct 16 02:26:35 2011 +0200
@@ -32,7 +32,7 @@
             coding = ct.parameters.get('charset', coding)
         data = data.decode(coding)
     if not isinstance(data, unicode):
-        raise TypeError("data must be rev or str (requires contenttype with charset) or unicode, but we got %r" % data)
+        raise TypeError("data must be rev or str (requires contenttype with charset) or unicode, but we got {0!r}".format(data))
     return data
 
 
--- a/MoinMoin/converter/_wiki_macro.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/_wiki_macro.py	Sun Oct 16 02:26:35 2011 +0200
@@ -82,11 +82,11 @@
             add_moin_xpointer(u'editlink')
 
         if xpointer_moin:
-            xpointer.append(u'page:include(%s)' % u' '.join(xpointer_moin))
+            xpointer.append(u'page:include({0})'.format(u' '.join(xpointer_moin)))
 
         if xpointer:
             # TODO: Namespace?
-            ns = 'xmlns(page=%s) ' % moin_page
+            ns = 'xmlns(page={0}) '.format(moin_page)
 
             attrib[xinclude.xpointer] = ns + ' '.join(xpointer)
 
@@ -108,7 +108,7 @@
         return moin_page.table_of_content(attrib=attrib)
 
     def macro(self, name, args, text, context_block=False):
-        func = getattr(self, '_%s_repl' % name, None)
+        func = getattr(self, '_{0}_repl'.format(name), None)
         if func is not None:
             return func(args, text, context_block)
 
--- a/MoinMoin/converter/archive_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/archive_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -37,7 +37,7 @@
 
     def process_name(self, member_name):
         attrib = {
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+self.item_name, query='do=get&member=%s' % member_name),
+            xlink.href: Iri(scheme='wiki', authority='', path='/'+self.item_name, query='do=get&member={0}'.format(member_name)),
         }
         return moin_page.a(attrib=attrib, children=[member_name, ])
 
--- a/MoinMoin/converter/audio_video_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/audio_video_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -31,7 +31,7 @@
         item_name = rev.item.name
         attrib = {
             moin_page.type_: unicode(self.input_type),
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev=%s' % rev.revid),
+            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
         }
         return moin_page.object_(attrib=attrib, children=[u'Your Browser does not support HTML5 audio/video element.', ])
 
--- a/MoinMoin/converter/creole_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/creole_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -668,7 +668,7 @@
         Call the _repl method for the last matched group with the given prefix.
         """
         data = dict(((k, v) for k, v in match.groupdict().iteritems() if v is not None))
-        getattr(self, '%s_%s_repl' % (prefix, match.lastgroup))(*args, **data)
+        getattr(self, '{0}_{1}_repl'.format(prefix, match.lastgroup))(*args, **data)
 
     def parse_block(self, iter_content, arguments):
         attrib = {}
--- a/MoinMoin/converter/docbook_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/docbook_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -353,7 +353,7 @@
 
         # We should ignore this element
         if element.tag.name in self.ignored_tags:
-            logging.warning("Ignored tag:%s" % element.tag.name)
+            logging.warning("Ignored tag:{0}".format(element.tag.name))
             return
 
         # We have an admonition element
--- a/MoinMoin/converter/docbook_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/docbook_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -159,7 +159,7 @@
 
         # Check that the tag is supported
         if element.tag.name in self.unsupported_tags:
-            logging.warning("Unsupported tag : %s" % element.tag.name)
+            logging.warning("Unsupported tag : {0}".format(element.tag.name))
             return self.do_children(element)
 
         method_name = 'visit_moinpage_' + element.tag.name.replace('-', '_')
@@ -168,7 +168,7 @@
             return method(element)
 
         # Otherwise we process the children of the unknown element
-        logging.warning("Unknown tag : %s" % element.tag.name)
+        logging.warning("Unknown tag : {0}".format(element.tag.name))
         return self.do_children(element)
 
     def visit_moinpage_a(self, element):
@@ -259,7 +259,7 @@
         # Need more test
         elif  depth < self.current_section:
             if self.parent_section != 0:
-                section_tag = 'sect%d' % self.parent_section
+                section_tag = 'sect{0}'.format(self.parent_section)
                 section = ET.Element(docbook(section_tag), attrib={},
                           children=self.section_children[self.current_section])
                 self.section_children[self.parent_section].append(section)
@@ -385,7 +385,7 @@
         title = element.get(html('title'))
         if not title:
             #TODO: Translation
-            title = "Table %d" % self.table_counter
+            title = "Table {0}".format(self.table_counter)
         self.table_counter = self.table_counter + 1
         caption = ET.Element(docbook('caption'), attrib={}, children=[title])
         children = [caption]
@@ -400,7 +400,7 @@
         attrib = {}
         rowspan = element.get(moin_page('number-rows-spanned'))
         colspan = element.get(moin_page('number-columns-spanned'))
-        print "rowspan : %s" % rowspan
+        print "rowspan : {0}".format(rowspan)
         if rowspan:
             attrib[docbook.rowspan] = rowspan
         if colspan:
@@ -448,12 +448,12 @@
                     section = None
                     for k, v in self.section_children:
                         if section:
-                            section_tag = 'sect%d' % k
+                            section_tag = 'sect{0}'.format(k)
                             v.append(section)
                             section = ET.Element(docbook(section_tag),
                                                  attrib={}, children=v)
                         else:
-                            section_tag = 'sect%d' % k
+                            section_tag = 'sect{0}'.format(k)
                             section = ET.Element(docbook(section_tag),
                                                  attrib={}, children=v)
                     return ET.Element(docbook.article,
@@ -462,8 +462,7 @@
                     c.insert(0, info)
                     return ET.Element(docbook.article, attrib={}, children=c)
 
-        raise RuntimeError('page:page need to contain exactly one page body tag, got %r'
-                            % element[:])
+        raise RuntimeError('page:page need to contain exactly one page body tag, got {0!r}'.format(element[:]))
 
     def visit_moinpage_p(self, element):
         """
--- a/MoinMoin/converter/everything.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/everything.py	Sun Oct 16 02:26:35 2011 +0200
@@ -25,9 +25,9 @@
     def __call__(self, rev, contenttype=None, arguments=None):
         item_name = rev.item.name
         attrib = {
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev=%s' % rev.revid),
+            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
         }
-        return moin_page.a(attrib=attrib, children=["Download %s." % item_name])
+        return moin_page.a(attrib=attrib, children=["Download {0}.".format(item_name)])
 
 
 from . import default_registry
--- a/MoinMoin/converter/html_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/html_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -229,11 +229,11 @@
 
         # We should ignore this tag
         if element.tag.name in self.ignored_tags:
-            logging.debug("WARNING : Ignored tag : %s" % element.tag.name)
+            logging.debug("WARNING : Ignored tag : {0}".format(element.tag.name))
             return
 
         # Otherwise we process children of the unknown element
-        logging.debug("WARNING : Unknown tag : %s" % element.tag.name)
+        logging.debug("WARNING : Unknown tag : {0}".format(element.tag.name))
         return self.do_children(element)
 
     def visit_xhtml_base(self, element):
--- a/MoinMoin/converter/html_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/html_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -240,7 +240,7 @@
             level = 1
         elif level > 6:
             level = 6
-        ret = self.new_copy(html('h%d' % level), elem)
+        ret = self.new_copy(html('h{0}'.format(level)), elem)
         ret.level = level
         return ret
 
@@ -303,7 +303,7 @@
                     attrib_new[html('class')] = 'moin-nobullet-list'
                 ret = html.ul(attrib=attrib_new)
             else:
-                raise ElementException('page:item-label-generate does not support "%s"' % generate)
+                raise ElementException('page:item-label-generate does not support "{0}"'.format(generate))
         else:
             ret = html.dl(attrib=attrib_new)
 
@@ -386,7 +386,7 @@
             if item.tag.uri == moin_page and item.tag.name == 'body':
                 return self.new_copy(html.div, item)
 
-        raise RuntimeError('page:page need to contain exactly one page:body tag, got %r' % elem[:])
+        raise RuntimeError('page:page need to contain exactly one page:body tag, got {0!r}'.format(elem[:]))
 
     def visit_moinpage_part(self, elem):
         body = error = None
@@ -458,7 +458,7 @@
             else:
                 attribute = {}
                 key = html('class')
-                attribute[key] = "element-%s" % generate
+                attribute[key] = "element-{0}".format(generate)
                 return self.new_copy(html.span, elem, attribute)
         # If no any attributes is handled by our converter, just return span
         return self.new_copy(html.span, elem)
@@ -505,7 +505,7 @@
         nr = self._ids[id] = self._ids.get(id, 0) + 1
         if nr == 1:
             return id
-        return id + u'-%d' % nr
+        return id + u'-{0}'.format(nr)
 
 
 class SpecialPage(object):
@@ -519,7 +519,7 @@
 
     def add_heading(self, elem, level, id=None):
         elem.append(html.a(attrib={
-            html.href: "#%s" % id,
+            html.href: "#{0}".format(id),
             html.class_: "permalink",
         }, children=(u"¶", )))
         self._headings.append((elem, level, id))
@@ -613,15 +613,15 @@
                         if maxlevel != 1:
                             stack_top_append(old_toggle)
                         stack_push(html.ol())
-                        stack_push(html.li({html.id_: 'li%s' % id}))
+                        stack_push(html.li({html.id_: 'li{0}'.format(id)}))
                         last_level += 1
                     if need_item:
                         stack.pop()
-                        stack_push(html.li({html.id_: 'li%s' % id}))
+                        stack_push(html.li({html.id_: 'li{0}'.format(id)}))
                     togglelink = html.a(attrib={
                                          html.href_: "#",
                                          html.onclick_:
-                                            "$('#li%s ol').toggle();return false;" % id,
+                                            "$('#li{0} ol').toggle();return false;".format(id),
                                          html.class_: 'showhide',
                                      },
                                      children=["[+]", ])
@@ -671,12 +671,12 @@
         id = self._id.gen_id('note')
 
         elem_ref = ET.XML("""
-<html:sup xmlns:html="%s" html:id="note-%d-ref" html:class="moin-footnote"><html:a html:href="#note-%d">%d</html:a></html:sup>
-""" % (html, id, id, id))
+<html:sup xmlns:html="{0}" html:id="note-{1}-ref" html:class="moin-footnote"><html:a html:href="#note-{2}">{3}</html:a></html:sup>
+""".format(html, id, id, id))
 
         elem_note = ET.XML("""
-<html:p xmlns:html="%s" html:id="note-%d"><html:sup><html:a html:href="#note-%d-ref">%d</html:a></html:sup></html:p>
-""" % (html, id, id, id))
+<html:p xmlns:html="{0}" html:id="note-{1}"><html:sup><html:a html:href="#note-{2}-ref">{3}</html:a></html:sup></html:p>
+""".format(html, id, id, id))
 
         elem_note.extend(body)
         self._special_stack[-1].add_footnote(elem_note)
--- a/MoinMoin/converter/image_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/image_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -29,7 +29,7 @@
         item_name = rev.item.name
         attrib = {
             moin_page.type_: unicode(self.input_type),
-            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev=%s' % rev.revid),
+            xlink.href: Iri(scheme='wiki', authority='', path='/'+item_name, query='do=get&rev={0}'.format(rev.revid)),
         }
         return moin_page.object_(attrib=attrib, children=[item_name, ])
 
--- a/MoinMoin/converter/include.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/include.py	Sun Oct 16 02:26:35 2011 +0200
@@ -221,8 +221,7 @@
                 included_elements = []
                 for page, page_href in pages:
                     if page_href in self.stack:
-                        w = ('<p xmlns="%s"><strong class="error">Recursive include of "%s" forbidden</strong></p>'
-                                % (html.namespace, page.name))
+                        w = ('<p xmlns="{0}"><strong class="error">Recursive include of "{1}" forbidden</strong></p>'.format(html.namespace, page.name))
                         div.append(ET.XML(w))
                         continue
                     # TODO: Is this correct?
--- a/MoinMoin/converter/link.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/link.py	Sun Oct 16 02:26:35 2011 +0200
@@ -130,7 +130,7 @@
                 if k == 'rev':
                     rev = v
                     continue # we remove rev=n from qs
-                result.append(u'%s=%s' % (k, v))
+                result.append(u'{0}={1}'.format(k, v))
         if result:
             query = separator.join(result)
         else:
--- a/MoinMoin/converter/macro.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/macro.py	Sun Oct 16 02:26:35 2011 +0200
@@ -78,7 +78,7 @@
             # and makes the wiki UI unusable (by emitting a Server Error),
             # thus, in case of exceptions, we just log the problem and return
             # some standard text.
-            logger.exception("Macro %s raised an exception:" % name)
+            logger.exception("Macro {0} raised an exception:".format(name))
             elem_error.append(_('<<%(macro_name)s: execution failed [%(error_msg)s] (see also the log)>>',
                     macro_name=name,
                     error_msg=unicode(e),
--- a/MoinMoin/converter/mediawiki_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/mediawiki_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -79,7 +79,7 @@
 
         for match in self._re.finditer(input):
             data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None))
-            getattr(self, '%s_repl' % match.lastgroup)(args, **data)
+            getattr(self, '{0}_repl'.format(match.lastgroup))(args, **data)
 
         return args
 
@@ -220,7 +220,7 @@
                     preprocessor_status = self.preprocessor.pop()
             elif m.group('text'):
                 self.preprocessor.push(preprocessor_status)
-                self.parse_inline('\n%s' % m.group('text'), stack, self.inline_re)
+                self.parse_inline('\n{0}'.format(m.group('text')), stack, self.inline_re)
                 preprocessor_status = self.preprocessor.pop()
         stack.pop_name('table')
 
@@ -871,10 +871,10 @@
                         if not tag_name in self.all_tags or re.match(r'.*/\s*$', tag)\
                                 or self.nowiki and (status or tag_name != self.nowiki_tag):
                             if not len(tags):
-                                post_line.append('<%s>' % tag)
+                                post_line.append('<{0}>'.format(tag))
                                 post_line.append(text)
                             else:
-                                tags[-1].text.append('<%s>' % tag)
+                                tags[-1].text.append('<{0}>'.format(tag))
                                 tags[-1].text.append(text)
                         else:
                             if not status:
@@ -888,7 +888,7 @@
                                     close_tag = self.Preprocessor_tag()
                                     while tag_name != close_tag.tag_name:
                                         close_tag = tags.pop()
-                                        tmp_line = '<%s>%s%s</%s>' % (close_tag.tag, ''.join(close_tag.text), tmp_line, close_tag.tag_name)
+                                        tmp_line = '<{0}>{1}{2}</{3}>'.format(close_tag.tag, ''.join(close_tag.text), tmp_line, close_tag.tag_name)
                                         if not len(tags):
                                             post_line.append(tmp_line)
                                         else:
@@ -920,7 +920,7 @@
         Call the _repl method for the last matched group with the given prefix.
         """
         data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None))
-        func = '%s_%s_repl' % (prefix, match.lastgroup)
+        func = '{0}_{1}_repl'.format(prefix, match.lastgroup)
         #logging.debug("calling %s(%r, %r)" % (func, args, data))
         getattr(self, func)(*args, **data)
 
--- a/MoinMoin/converter/moinwiki_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/moinwiki_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -183,7 +183,7 @@
         args.keyword['style'] = args.keyword.get('style', "") + attr + " "
 
     def hex_color_code_repl(self, args, hex_color_code):
-        self.add_attr_to_style(args, "background-color: #%s;" % hex_color_code)
+        self.add_attr_to_style(args, "background-color: #{0};".format(hex_color_code))
 
     def vertical_align_top_repl(self, args, vertical_align_top):
         self.add_attr_to_style(args, "vertical-align: top;")
@@ -201,7 +201,7 @@
         self.add_attr_to_style(args, "text-align: right;")
 
     def width_percent_repl(self, args, width_percent):
-        self.add_attr_to_style(args, "width: %s;" % width_percent)
+        self.add_attr_to_style(args, "width: {0};".format(width_percent))
 
     def syntax_error_repl(self, args, syntax_error):
         args.keyword['error'] = syntax_error
@@ -211,7 +211,7 @@
 
         for match in self._re.finditer(input):
             data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None))
-            getattr(self, '%s_repl' % match.lastgroup)(args, **data)
+            getattr(self, '{0}_repl'.format(match.lastgroup))(args, **data)
 
         return args
 
@@ -382,11 +382,11 @@
 
     block_separator = r'(?P<separator> ^ \s* -{4,} \s* $ )'
 
-    def block_separator_repl(self, _iter_content, stack, separator, hr_class = u'moin-hr%s'):
+    def block_separator_repl(self, _iter_content, stack, separator, hr_class = u'moin-hr{0}'):
         stack.clear()
         hr_height = min((len(separator) - 3), 6)
         hr_height = max(hr_height, 1)
-        attrib = {moin_page('class'): hr_class % hr_height}
+        attrib = {moin_page('class'): hr_class.format(hr_height)}
         elem = moin_page.separator(attrib = attrib)
         stack.top_append(elem)
 
@@ -800,7 +800,7 @@
                 return
             else:
                 # assume local language uses ":" inside of words, set link_item and continue
-                link_item = '%s:%s' % (link_interwiki_site, link_interwiki_item)
+                link_item = '{0}:{1}'.format(link_interwiki_site, link_interwiki_item)
         if link_args:
             link_args = parse_arguments(link_args) # XXX needs different parsing
             query = url_encode(link_args.keyword, charset=config.charset, encode_keys=True)
@@ -993,15 +993,15 @@
                 if key == 'bgcolor':
                     if no_errors:
                         # avoid overriding error highlighting
-                        add_attr_to_style(element.attrib, 'background-color: %s;' % value)
+                        add_attr_to_style(element.attrib, 'background-color: {0};'.format(value))
                 elif key == 'rowbgcolor':
-                    add_attr_to_style(row.attrib, 'background-color: %s;' % value)
+                    add_attr_to_style(row.attrib, 'background-color: {0};'.format(value))
                 elif key == 'tablebgcolor':
-                    add_attr_to_style(table.attrib, 'background-color: %s;' % value)
+                    add_attr_to_style(table.attrib, 'background-color: {0};'.format(value))
                 elif key == 'width':
-                    add_attr_to_style(element.attrib, 'width: %s' % value)
+                    add_attr_to_style(element.attrib, 'width: {0};'.format(value))
                 elif key == 'tablewidth':
-                    add_attr_to_style(table.attrib, 'width: %s;' % value)
+                    add_attr_to_style(table.attrib, 'width: {0};'.format(value))
                 elif key == 'tableclass':
                     table.attrib[moin_page('class')] = value
                 elif key == 'rowclass':
@@ -1034,7 +1034,7 @@
                     cell_markup = cell_markup.split('<')[1]
                     msg1 = _('Error:')
                     msg2 = _('is invalid within')
-                    cell_text = '[ %s "%s" %s <%s>&nbsp;]<<BR>>%s' % (msg1, error, msg2, cell_markup, cell_text)
+                    cell_text = '[ {0} "{1}" {2} <{3}>&nbsp;]<<BR>>{4}'.format(msg1, error, msg2, cell_markup, cell_text)
                     if no_errors:
                         add_attr_to_style(element.attrib, 'background-color: pink; color: black;')
                     no_errors = False
@@ -1096,7 +1096,7 @@
         Call the _repl method for the last matched group with the given prefix.
         """
         data = dict(((str(k), v) for k, v in match.groupdict().iteritems() if v is not None))
-        func = '%s_%s_repl' % (prefix, match.lastgroup)
+        func = '{0}_{1}_repl'.format(prefix, match.lastgroup)
         #logging.debug("calling %s(%r, %r)" % (func, args, data))
         getattr(self, func)(*args, **data)
 
--- a/MoinMoin/converter/moinwiki_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/moinwiki_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -139,7 +139,7 @@
                 elif self.status[-1] == "text":
                     if self.last_closed == "p":
                         ret = u'\n'
-                childrens_output.append(u'%s%s' % (ret, child))
+                childrens_output.append(u'{0}{1}'.format(ret, child))
                 self.last_closed = 'text'
         return u''.join(childrens_output)
 
@@ -171,7 +171,7 @@
         params['class'] = elem.get(xlink.class_, None)
         params['title'] = elem.get(xlink.title, None)
         params['accesskey'] = elem.get(xlink.accesskey, None)
-        params = u','.join([u'%s=%s' % (p, params[p]) for p in params if params[p]])
+        params = u','.join([u'{0}={1}'.format(p, params[p]) for p in params if params[p]])
 
         # XXX: We don't have Iri support for now
         from MoinMoin.util.iri import Iri
@@ -204,7 +204,7 @@
         for s in findall(r'}+', text):
             if max_subpage_lvl <= len(s):
                 max_subpage_lvl = len(s) + 1
-        ret = u'%s\n%s\n%s\n' % (Moinwiki.verbatim_open * max_subpage_lvl, text, Moinwiki.verbatim_close * max_subpage_lvl)
+        ret = u'{0}\n{1}\n{2}\n'.format(Moinwiki.verbatim_open * max_subpage_lvl, text, Moinwiki.verbatim_close * max_subpage_lvl)
         return ret
 
     def open_moinpage_code(self, elem):
@@ -218,7 +218,7 @@
 
     def open_moinpage_emphasis(self, elem):
         childrens_output = self.open_children(elem)
-        return u"%s%s%s" % (Moinwiki.emphasis, childrens_output, Moinwiki.emphasis)
+        return u"{0}{1}{2}".format(Moinwiki.emphasis, childrens_output, Moinwiki.emphasis)
 
     def open_moinpage_h(self, elem):
         level = elem.get(moin_page.outline_level, 1)
@@ -232,7 +232,7 @@
             level = 6
         ret = Moinwiki.h * level + u' '
         ret += u''.join(elem.itertext())
-        ret += u' %s\n' % (Moinwiki.h * level)
+        ret += u' {0}\n'.format(Moinwiki.h * level)
         return ret
 
     def open_moinpage_line_break(self, elem):
@@ -257,7 +257,7 @@
             ret_end = u''
         else:
             ret_end = u'\n'
-        return "%s%s%s" % (ret, childrens_output, ret_end)
+        return "{0}{1}{2}".format(ret, childrens_output, ret_end)
 
     def open_moinpage_list_item(self, elem):
         self.list_item_label = self.list_item_labels[-1] + u' '
@@ -270,9 +270,9 @@
             self.list_item_label = self.list_item_labels[-1] + u' '
             ret = u' ' * (len(u''.join(self.list_item_labels[:-1])) + len(self.list_item_labels[:-1]))# self.list_level
             if self.last_closed:
-                ret = u'\n%s' % ret
+                ret = u'\n{0}'.format(ret)
         childrens_output = self.open_children(elem)
-        return "%s%s%s" % (ret, childrens_output, Moinwiki.definition_list_marker)
+        return "{0}{1}{2}".format(ret, childrens_output, Moinwiki.definition_list_marker)
 
     def open_moinpage_list_item_body(self, elem):
         ret = u''
@@ -286,7 +286,7 @@
         if class_:
             self.status.append('table')
             if class_ == "footnote":
-                return u'<<FootNote(%s)>>' % self.open_children(elem)
+                return u'<<FootNote({0})>>'.format(self.open_children(elem))
             self.status.pop()
         return u''
 
@@ -354,7 +354,7 @@
             for s in findall(r'}+', childrens_output):
                 if max_subpage_lvl <= len(s):
                     max_subpage_lvl = len(s) + 1
-            return u'%s%s%s%s\n' % (Moinwiki.verbatim_open * max_subpage_lvl, ret, childrens_output, Moinwiki.verbatim_close * max_subpage_lvl)
+            return u'{0}{1}{2}{3}\n'.format(Moinwiki.verbatim_open * max_subpage_lvl, ret, childrens_output, Moinwiki.verbatim_close * max_subpage_lvl)
 
         self.status.append('text')
         childrens_output = self.open_children(elem)
@@ -364,33 +364,33 @@
     def open_moinpage_body(self, elem):
         class_ = elem.get(moin_page.class_, u'').replace(u' ', u'/')
         if class_:
-            ret = u' %s\n' % class_
+            ret = u' {0}\n'.format(class_)
         elif len(self.status) > 2:
             ret = u'\n'
         else:
             ret = u''
         childrens_output = self.open_children(elem)
-        return u"%s%s" % (ret, childrens_output)
+        return u"{0}{1}".format(ret, childrens_output)
 
     def open_moinpage_part(self, elem):
         type = elem.get(moin_page.content_type, u"").split(u';')
         if len(type) == 2:
             if type[0] == "x-moin/macro":
                 if len(elem) and iter(elem).next().tag.name == "arguments":
-                    return u"<<%s(%s)>>\n" % (type[1].split(u'=')[1], u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == u"argument"]))
+                    return u"<<{0}({1})>>\n".format(type[1].split(u'=')[1], u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == u"argument"]))
                 else:
-                    return u"<<%s()>>\n" % type[1].split(u'=')[1]
+                    return u"<<{0}()>>\n".format(type[1].split(u'=')[1])
             elif type[0] == "x-moin/format":
                 elem_it = iter(elem)
-                ret = u"{{{#!%s" % type[1].split(u'=')[1]
+                ret = u"{{{{{{#!{0}".format(type[1].split(u'=')[1])
                 if len(elem) and elem_it.next().tag.name == "arguments":
                     args = []
                     for arg in iter(elem).next():
                         if arg.tag.name == "argument":
-                            args.append(u"%s=\"%s\"" % (arg.get(moin_page.name, u""), u' '.join(arg.itertext())))
-                    ret = u'%s(%s)' % (ret, u' '.join(args))
+                            args.append(u"{0}=\"{1}\"".format(arg.get(moin_page.name, u""), u' '.join(arg.itertext())))
+                    ret = u'{0}({1})'.format(ret, u' '.join(args))
                     elem = elem_it.next()
-                ret = u"%s\n%s\n}}}\n" % (ret, u' '.join(elem.itertext()))
+                ret = u"{0}\n{1}\n}}}}}}\n".format(ret, u' '.join(elem.itertext()))
                 return ret
         return unescape(elem.get(moin_page.alt, u'')) + u"\n"
 
@@ -409,7 +409,7 @@
                 if (0 <= height <= 5):
                     hr_ending = (u'-' * height) + hr_ending
             except:
-                raise ElementException('page:separator has invalid class %s' % hr_class)
+                raise ElementException('page:separator has invalid class {0}'.format(hr_class))
         return Moinwiki.separator + hr_ending
 
     def open_moinpage_span(self, elem):
@@ -422,20 +422,20 @@
         if text_decoration == u'underline':
             return Moinwiki.underline + self.open_children(elem) + Moinwiki.underline
         if font_size:
-            return u"%s%s%s" % (Moinwiki.larger_open if font_size == u"120%"\
-                                        else Moinwiki.smaller_open,
-                                self.open_children(elem),
-                                Moinwiki.larger_close if font_size == u"120%"\
-                                                      else Moinwiki.smaller_close)
+            return u"{0}{1}{2}".format(Moinwiki.larger_open if font_size == u"120%"\
+                                           else Moinwiki.smaller_open,
+                                       self.open_children(elem),
+                                       Moinwiki.larger_close if font_size == u"120%"\
+                                           else Moinwiki.smaller_close)
         if baseline_shift == u'super':
-            return u'^%s^' % u''.join(elem.itertext())
+            return u'^{0}^'.format(u''.join(elem.itertext()))
         if baseline_shift == u'sub':
-            return u',,%s,,' % u''.join(elem.itertext())
+            return u',,{0},,'.format(u''.join(elem.itertext()))
         return u''
 
     def open_moinpage_strong(self, elem):
         ret = Moinwiki.strong
-        return u"%s%s%s" % (Moinwiki.strong, self.open_children(elem), Moinwiki.strong)
+        return u"{0}{1}{2}".format(Moinwiki.strong, self.open_children(elem), Moinwiki.strong)
 
     def open_moinpage_table(self, elem):
         self.table_tableclass = elem.attrib.get('class', u'')
@@ -486,33 +486,33 @@
 
         # TODO: maybe this can be written shorter
         if self.table_tableclass:
-            attrib.append(u'tableclass="%s"' % self.table_tableclass)
+            attrib.append(u'tableclass="{0}"'.format(self.table_tableclass))
             self.table_tableclass = u''
         if self.table_tablestyle:
-            attrib.append(u'tablestyle="%s"' % self.table_tablestyle)
+            attrib.append(u'tablestyle="{0}"'.format(self.table_tablestyle))
             self.table_tableclass = u''
         if self.table_rowclass:
-            attrib.append(u'rowclass="%s"' % self.table_rowclass)
+            attrib.append(u'rowclass="{0}"'.format(self.table_rowclass))
             self.table_rowclass = u''
         if self.table_rowstyle:
-            attrib.append(u'rowclass="%s"' % self.table_rowstyle)
+            attrib.append(u'rowclass="{0}"'.format(self.table_rowstyle))
             self.table_rowstyle = u''
         if table_cellclass:
-            attrib.append(u'class="%s"' % table_cellclass)
+            attrib.append(u'class="{0}"'.format(table_cellclass))
         if table_cellstyle:
-            attrib.append(u'style="%s"' % table_cellstyle)
+            attrib.append(u'style="{0}"'.format(table_cellstyle))
         if number_rows_spanned:
             attrib.append(u'|'+unicode(number_rows_spanned))
 
         attrib = u' '.join(attrib)
 
         if attrib:
-            ret += u'<%s>' % attrib
+            ret += u'<{0}>'.format(attrib)
         childrens_output = self.open_children(elem)
         return ret + childrens_output
 
     def open_moinpage_table_of_content(self, elem):
-        return u"<<TableOfContents(%s)>>\n" % elem.get(moin_page.outline_level, u"")
+        return u"<<TableOfContents({0})>>\n".format(elem.get(moin_page.outline_level, u""))
 
 from . import default_registry
 from MoinMoin.util.mime import Type, type_moin_document, type_moin_wiki
--- a/MoinMoin/converter/pygments_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/pygments_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -79,7 +79,7 @@
                     ('pascal', 'Delphi'),
                 ]
                 for moin_format, pygments_name in moin_pygments:
-                    if Type('x-moin/format;name=%s' % moin_format).issupertype(type_input):
+                    if Type('x-moin/format;name={0}'.format(moin_format)).issupertype(type_input):
                         break
                 else:
                     pygments_name = None
@@ -97,7 +97,7 @@
             """
             if lexer is None and contenttype is not None:
                 ct = Type(contenttype)
-                mimetype = '%s/%s' % (ct.type, ct.subtype) # pygments can't process parameters (like e.g. ...;charset=utf-8)
+                mimetype = '{0}/{1}'.format(ct.type, ct.subtype) # pygments can't process parameters (like e.g. ...;charset=utf-8)
                 try:
                     lexer = pygments.lexers.get_lexer_for_mimetype(mimetype)
                 except pygments.util.ClassNotFound:
--- a/MoinMoin/converter/rst_in.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/rst_in.py	Sun Oct 16 02:26:35 2011 +0200
@@ -281,7 +281,7 @@
     def visit_field_name(self, node):
         self.open_moin_page_node(moin_page.table_cell())
         self.open_moin_page_node(moin_page.strong())
-        self.open_moin_page_node(u'%s:' % node.astext())
+        self.open_moin_page_node(u'{0}:'.format(node.astext()))
         node.children = []
         self.close_moin_page_node()
 
@@ -400,7 +400,7 @@
             for name, value in named_args:
                 args.append(moin_page.argument(attrib={moin_page.name: name}, children=[value]))
             arguments = moin_page.arguments(children=args)
-            self.open_moin_page_node(moin_page.part(children=[arguments], attrib={moin_page.content_type: "x-moin/format;name=%s" % parser.split(' ')[0]}))
+            self.open_moin_page_node(moin_page.part(children=[arguments], attrib={moin_page.content_type: "x-moin/format;name={0}".format(parser.split(' ')[0])}))
         else:
             self.open_moin_page_node(moin_page.blockcode())
 
@@ -444,7 +444,7 @@
                 moin_page.part(
                     attrib={
                         moin_page.content_type:\
-                            "x-moin/macro;name=%s" % macro_name, }))
+                            "x-moin/macro;name={0}".format(macro_name)}))
             if arguments:
                 self.open_moin_page_node(moin_page.arguments())
                 for i in arguments:
@@ -678,7 +678,7 @@
             return []
 
         if content:
-            macro = u'<<Include(%s)>>' % content[0]
+            macro = u'<<Include({0})>>'.format(content[0])
         else:
             macro = u'<<Include()>>'
         ref = reference(macro, refuri=macro)
@@ -703,7 +703,7 @@
             if content[0].startswith(u'<<'):
                 macro = content[0]
             else:
-                macro = u'<<%s>>' % content[0]
+                macro = u'<<{0}>>'.format(content[0])
             ref = reference(macro, refuri=macro)
             ref['name'] = macro
             return [ref]
@@ -722,7 +722,7 @@
             if m and len(m.groups()) == 2:
                 if m.groups()[0] == u'depth':
                     text = m.groups()[1]
-        macro = u'<<TableOfContents(%s)>>' % text
+        macro = u'<<TableOfContents({0})>>'.format(text)
         ref = reference(macro, refuri=macro)
         ref['name'] = macro
         return [ref]
@@ -764,10 +764,10 @@
                     str_num = string_numb.group(1)
                     input = input.split('\n')
                     if str_num:
-                        input = ['.. error::\n ::\n\n  Parse error on line number %s:\n\n  %s\n\n  Go back and try fix that.\n\n' % (str_num, string_numb.group(2).replace('\n', '\n  '))]
+                        input = ['.. error::\n ::\n\n  Parse error on line number {0}:\n\n  {1}\n\n  Go back and try fix that.\n\n'.format(str_num, string_numb.group(2).replace('\n', '\n  '))]
                         continue
                 else:
-                    input = ['.. error::\n ::\n\n  %s\n\n' % str(inst).replace('\n', '\n  ')]
+                    input = ['.. error::\n ::\n\n  {0}\n\n'.format(str(inst).replace('\n', '\n  '))]
                 raise inst
             break
         visitor = NodeVisitor()
--- a/MoinMoin/converter/rst_out.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/converter/rst_out.py	Sun Oct 16 02:26:35 2011 +0200
@@ -303,9 +303,9 @@
         self.used_references = []
         self.delete_newlines = False
         ret = self.open(root)
-        notes = u"\n\n".join(u".. [#] %s" % note.replace(u"\n", u"\n  ") for note in self.footnotes)
+        notes = u"\n\n".join(u".. [#] {0}".format(note.replace(u"\n", u"\n  ")) for note in self.footnotes)
         if notes:
-            return ret + self.define_references() + u"\n\n%s\n\n" % notes
+            return ret + self.define_references() + u"\n\n{0}\n\n".format(notes)
 
         return ret + self.define_references()
 
@@ -334,7 +334,7 @@
                         childrens_output.append(u'\n\n')
                 elif self.status[-1] == "list":
                     child =\
-                        re.sub(r"\n(.)", lambda m: u"\n%s%s" % (u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
+                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
                     if self.last_closed == "p":
                         childrens_output.append(u'\n'\
                                 + u' '\
@@ -346,7 +346,7 @@
                         childrens_output.append(u'\n')
                 elif self.status[-2] == "list":
                     child =\
-                        re.sub(r"\n(.)", lambda m: u"\n%s%s" % (u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
+                        re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), child)
                 childrens_output.append(child)
                 self.last_closed = 'text'
         self.delete_newlines = delete_newlines
@@ -377,18 +377,18 @@
         # TODO: check that links have different alt texts
         if text in [t for (t, h) in self.all_used_references]:
             if (text, href) in self.all_used_references:
-                return u"`%s`_" % text
+                return u"`{0}`_".format(text)
             if not self.anonymous_reference:
                 self.anonymous_reference = href
                 self.used_references.insert(0, (u"_", href))
-                return u"`%s`__" % text
+                return u"`{0}`__".format(text)
             else:
                 while text in [t for (t, h) in self.all_used_references]:
                     text = text + u"~"
         self.used_references.append((text, href))
         self.all_used_references.append((text, href))
         #self.objects.append("\n\n.. _%s: %s\n\n" % (text, href))
-        return u"`%s`_" % text
+        return u"`{0}`_".format(text)
 
     def open_moinpage_blockcode(self, elem):
         text = u''.join(elem.itertext())
@@ -408,19 +408,15 @@
                 if i:
                     self.output[-1] = self.output[-1][:i]
             """
-        return  u"::\n\n  %s%s\n\n" % (u' '\
-                                    * (len(u''.join(self.list_item_labels))\
-                                       + len(self.list_item_labels)), text)
+        return u"::\n\n  {0}{1}\n\n".format(u' ' * (len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), text)
 
     def open_moinpage_code(self, elem):
-        ret = u"%s%s%s" % (ReST.monospace,\
-                          u''.join(elem.itertext()),\
-                          ReST.monospace)
+        ret = u"{0}{1}{2}".format(ReST.monospace, u''.join(elem.itertext()), ReST.monospace)
         return ret
 
     def open_moinpage_emphasis(self, elem):
         childrens_output = self.open_children(elem)
-        return u"%s%s%s" % (ReST.emphasis, childrens_output, ReST.emphasis)
+        return u"{0}{1}{2}".format(ReST.emphasis, childrens_output, ReST.emphasis)
 
     def open_moinpage_h(self, elem):
         level = elem.get(moin_page.outline_level, 1)
@@ -433,9 +429,7 @@
             level = 1
         elif level > 6:
             level = 6
-        ret = u"\n\n%s\n%s\n%s\n\n" % (ReST.h[level]*len(text),\
-                                      text,\
-                                      ReST.h[level]*len(text))
+        ret = u"\n\n{0}\n{1}\n{2}\n\n".format(ReST.h[level] * len(text), text, ReST.h[level] * len(text))
         return ret
 
     def open_moinpage_line_break(self, elem):
@@ -482,7 +476,7 @@
                   * (len(u''.join(self.list_item_labels[:-1]))\
                      + len(self.list_item_labels[:-1]))
             if self.last_closed and self.last_closed != 'list':
-                ret = u'\n%s' % ret
+                ret = u'\n{0}'.format(ret)
             return ret + self.open_children(elem)
         return self.open_children(elem)
 
@@ -523,11 +517,11 @@
         if not alt:
             ret = u''
         else:
-            ret = u'|%s|' % alt
+            ret = u'|{0}|'.format(alt)
         args_text = u''
         if args:
-            args_text = u"\n  %s" % u'\n  '.join(u':%s: %s' % (arg.split(u'=')[0], arg.split(u'=')[1]) for arg in args)
-        self.objects.append(u".. %s image:: %s%s" % (ret, href, args_text))
+            args_text = u"\n  {0}".format(u'\n  '.join(u':{0}: {1}'.format(arg.split(u'=')[0], arg.split(u'=')[1]) for arg in args))
+        self.objects.append(u".. {0} image:: {1}{2}".format(ret, href, args_text))
         return ret
 
     def open_moinpage_p(self, elem):
@@ -592,29 +586,24 @@
         if len(type) == 2:
             if type[0] == u"x-moin/macro":
                 if len(elem) and iter(elem).next().tag.name == "arguments":
-                    alt = u"<<%s(%s)>>"  % (type[1].split(u'=')[1],
-                                    u','.join([u''.join(c.itertext())\
-                                        for c in iter(elem).next()\
-                                        if c.tag.name == "argument"]))
+                    alt = u"<<{0}({1})>>".format(type[1].split(u'=')[1], u','.join([u''.join(c.itertext()) for c in iter(elem).next() if c.tag.name == "argument"]))
                 else:
-                    alt = u"<<%s()>>" % type[1].split(u'=')[1]
+                    alt = u"<<{0}()>>".format(type[1].split(u'=')[1])
 
-                obj = u".. |%s| macro:: %s" % (alt, alt)
+                obj = u".. |{0}| macro:: {1}".format(alt, alt)
                 self.objects.append(obj)
-                return u" |%s| " % alt
+                return u" |{0}| ".format(alt)
             elif type[0] == u"x-moin/format":
                 elem_it = iter(elem)
-                ret = u"\n\n.. parser:%s" % type[1].split(u'=')[1]
+                ret = u"\n\n.. parser:{0}".format(type[1].split(u'=')[1])
                 if len(elem) and elem_it.next().tag.name == "arguments":
                     args = []
                     for arg in iter(elem).next():
                         if arg.tag.name == "argument":
-                            args.append(u"%s=\"%s\""\
-                                        % (arg.get(moin_page.name, u""),
-                                           u' '.join(arg.itertext())))
-                    ret = u'%s %s' % (ret, u' '.join(args))
+                            args.append(u"{0}=\"{1}\"".format(arg.get(moin_page.name, u""), u' '.join(arg.itertext())))
+                    ret = u'{0} {1}'.format(ret, u' '.join(args))
                     elem = elem_it.next()
-                ret = u"%s\n  %s" % (ret, u' '.join(elem.itertext()))
+                ret = u"{0}\n  {1}".format(ret, u' '.join(elem.itertext()))
                 return ret
         return elem.get(moin_page.alt, u'') + u"\n"
 
@@ -645,9 +634,9 @@
             return ''
         """
         if baseline_shift == 'super':
-            return u"\\ :sup:`%s`\\ " % u''.join(elem.itertext())
+            return u"\\ :sup:`{0}`\\ ".format(u''.join(elem.itertext()))
         if baseline_shift == 'sub':
-            return u"\\ :sub:`%s`\\ " % u''.join(elem.itertext())
+            return u"\\ :sub:`{0}`\\ ".format(u''.join(elem.itertext()))
         return self.open_children(elem)
 
     def open_moinpage_strong(self, elem):
@@ -667,7 +656,7 @@
         table = repr(self.tablec)
         if self.status[-1] == "list":
             table =\
-                re.sub(r"\n(.)", lambda m: u"\n%s%s" % (u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), u"\n" + table)
+                re.sub(r"\n(.)", lambda m: u"\n{0}{1}".format(u' '*(len(u''.join(self.list_item_labels)) + len(self.list_item_labels)), m.group(1)), u"\n" + table)
             return table + ReST.p
         return table + ReST.linebreak
 
@@ -721,21 +710,21 @@
         # TODO: styles and classes
         """
         if self.table_tableclass:
-            attrib.append('tableclass="%s"' % self.table_tableclass)
+            attrib.append('tableclass="{0}"'.format(self.table_tableclass))
             self.table_tableclass = ''
         if self.table_tablestyle:
-            attrib.append('tablestyle="%s"' % self.table_tablestyle)
+            attrib.append('tablestyle="{0}"'.format(self.table_tablestyle))
             self.table_tableclass = ''
         if self.table_rowclass:
-            attrib.append('rowclass="%s"' % self.table_rowclass)
+            attrib.append('rowclass="{0}"'.format(self.table_rowclass))
             self.table_rowclass = ''
         if self.table_rowstyle:
-            attrib.append('rowclass="%s"' % self.table_rowstyle)
+            attrib.append('rowclass="{0}"'.format(self.table_rowstyle))
             self.table_rowstyle = ''
         if table_cellclass:
-            attrib.append('class="%s"' % table_cellclass)
+            attrib.append('class="{0}"'.format(table_cellclass))
         if table_cellstyle:
-            attrib.append('style="%s"' % table_cellstyle)
+            attrib.append('style="{0}"'.format(table_cellstyle))
         if number_rows_spanned:
             attrib.append('|'+str(number_rows_spanned))
 
@@ -752,7 +741,7 @@
         depth = elem.get(moin_page.outline_level, u"")
         ret = u"\n\n.. contents::"
         if depth:
-            ret += u"\n   :depth: %s" % depth
+            ret += u"\n   :depth: {0}".format(depth)
         return ret + u"\n\n"
 
     def define_references(self):
@@ -763,8 +752,7 @@
         self.all_used_references.extend(self.used_references)
         definitions = [u" " * (len(u''.join(self.list_item_labels))\
                                     + len(self.list_item_labels))\
-                                  + u".. _%s: %s"\
-                                    % link for link in self.used_references]
+                                  + u".. _{0}: {1}".format(t, h) for t, h in self.used_references]
         definitions.extend(u" " * (len(u''.join(self.list_item_labels))\
                                      + len(self.list_item_labels))\
                                   + link for link in self.objects)
@@ -772,9 +760,9 @@
 
         if definitions:
             if self.last_closed == 'list_item_label':
-                ret += u"\n%s\n\n" % definition_block
+                ret += u"\n{0}\n\n".format(definition_block)
             else:
-                ret += u"\n\n%s\n\n" % definition_block
+                ret += u"\n\n{0}\n\n".format(definition_block)
 
         self.used_references = []
         self.objects = []
--- a/MoinMoin/datastruct/backends/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/datastruct/backends/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -80,7 +80,7 @@
         raise NotImplementedError()
 
     def __repr__(self):
-        return "<%s groups=%s>" % (self.__class__, list(self))
+        return "<{0} groups={1}>".format(self.__class__, list(self))
 
     def _retrieve_members(self, group_name):
         raise NotImplementedError()
@@ -250,10 +250,7 @@
                     yield group_name
 
     def __repr__(self):
-        return "<%s name=%s members=%s member_groups=%s>" % (self.__class__,
-                                                             self.name,
-                                                             self.members,
-                                                             self.member_groups)
+        return "<{0} name={1} members={2} member_groups={3}>".format(self.__class__, self.name, self.members, self.member_groups)
 
 
 class BaseDict(object, DictMixin):
@@ -297,7 +294,7 @@
         return self._backend._retrieve_items(self.name)
 
     def __repr__(self):
-        return "<%r name=%r items=%r>" % (self.__class__, self.name, self._dict.items())
+        return "<{0!r} name={1!r} items={2!r}>".format(self.__class__, self.name, self._dict.items())
 
 
 class BaseDictsBackend(object):
--- a/MoinMoin/datastruct/backends/_tests/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/datastruct/backends/_tests/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -95,7 +95,7 @@
 
         for user in self.expanded_groups['AdminGroup']:
             for permission in ["read", "write", "admin"]:
-                assert acl.may(u"Admin1", permission), '%s must have %s permission because he is member of the AdminGroup' % (user, permission)
+                assert acl.may(u"Admin1", permission), '{0} must have {1} permission because he is member of the AdminGroup'.format(user, permission)
 
     def test_backend_acl_deny(self):
         """
@@ -107,7 +107,7 @@
 
         assert u"SomeUser" not in flaskg.groups['AdminGroup']
         for permission in ["read", "write"]:
-            assert not acl.may(u"SomeUser", permission), 'SomeUser must not have %s permission because he is not listed in the AdminGroup' % permission
+            assert not acl.may(u"SomeUser", permission), 'SomeUser must not have {0} permission because he is not listed in the AdminGroup'.format(permission)
 
         assert u'Admin1' in flaskg.groups['AdminGroup']
         assert not acl.may(u"Admin1", "admin")
--- a/MoinMoin/datastruct/backends/composite_dicts.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/datastruct/backends/composite_dicts.py	Sun Oct 16 02:26:35 2011 +0200
@@ -43,5 +43,5 @@
         return False
 
     def __repr__(self):
-        return "<%s backends=%s>" % (self.__class__, self._backends)
+        return "<{0} backends={1}>".format(self.__class__, self._backends)
 
--- a/MoinMoin/datastruct/backends/composite_groups.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/datastruct/backends/composite_groups.py	Sun Oct 16 02:26:35 2011 +0200
@@ -66,5 +66,5 @@
         return False
 
     def __repr__(self):
-        return "<%s backends=%s>" % (self.__class__, self._backends)
+        return "<{0} backends={1}>".format(self.__class__, self._backends)
 
--- a/MoinMoin/i18n/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/i18n/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -43,20 +43,20 @@
     if u and u.locale is not None:
         # locale is given in user profile, use it
         locale = u.locale
-        logging.debug("user locale = %r" % locale)
+        logging.debug("user locale = {0!r}".format(locale))
     else:
         # try to guess the language from the user accept
         # header the browser transmits. The best match wins.
-        logging.debug("request.accept_languages = %r" % request.accept_languages)
+        logging.debug("request.accept_languages = {0!r}".format(request.accept_languages))
         supported_locales = [Locale('en')] + current_app.babel_instance.list_translations()
-        logging.debug("supported_locales = %r" % supported_locales)
+        logging.debug("supported_locales = {0!r}".format(supported_locales))
         supported_languages = [str(l) for l in supported_locales]
-        logging.debug("supported_languages = %r" % supported_languages)
+        logging.debug("supported_languages = {0!r}".format(supported_languages))
         locale = request.accept_languages.best_match(supported_languages, 'en')
-        logging.debug("best match locale = %r" % locale)
+        logging.debug("best match locale = {0!r}".format(locale))
     if not locale:
         locale = current_app.cfg.locale_default
-        logging.debug("default locale = %r" % locale)
+        logging.debug("default locale = {0!r}".format(locale))
     return locale
 
 
--- a/MoinMoin/items/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/items/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -111,7 +111,7 @@
             return NotImplemented
 
         def __repr__(self):
-            return '<%s: %s, prio %d [%r]>' % (self.__class__.__name__,
+            return '<{0}: {1}, prio {2} [{3!r}]>' % (self.__class__.__name__,
                     self.content_type,
                     self.priority,
                     self.factory)
@@ -177,12 +177,12 @@
             else:
                 name = item.name
         if not item: # except NoSuchItemError:
-            logging.debug("No such item: %r" % name)
+            logging.debug("No such item: {0!r}".format(name))
             item = DummyItem(name)
             rev = DummyRev(item, contenttype)
-            logging.debug("Item %r, created dummy revision with contenttype %r" % (name, contenttype))
+            logging.debug("Item {0!r}, created dummy revision with contenttype {1!r}".format(name, contenttype))
         else:
-            logging.debug("Got item: %r" % name)
+            logging.debug("Got item: {0!r}".format(name))
             try:
                 rev = item.get_revision(rev_id)
                 contenttype = u'application/octet-stream' # it exists
@@ -191,16 +191,16 @@
                     rev = item.get_revision(CURRENT) # fall back to current revision
                     # XXX add some message about invalid revision
                 except KeyError: # NoSuchRevisionError:
-                    logging.debug("Item %r has no revisions." % name)
+                    logging.debug("Item {0!r} has no revisions.".format(name))
                     rev = DummyRev(item, contenttype)
-                    logging.debug("Item %r, created dummy revision with contenttype %r" % (name, contenttype))
-            logging.debug("Got item %r, revision: %r" % (name, rev_id))
+                    logging.debug("Item {0!r}, created dummy revision with contenttype {1!r}".format(name, contenttype))
+            logging.debug("Got item {0!r}, revision: {1!r}".format(name, rev_id))
         contenttype = rev.meta.get(CONTENTTYPE) or contenttype # use contenttype in case our metadata does not provide CONTENTTYPE
-        logging.debug("Item %r, got contenttype %r from revision meta" % (name, contenttype))
+        logging.debug("Item {0!r}, got contenttype {1!r} from revision meta".format(name, contenttype))
         #logging.debug("Item %r, rev meta dict: %r" % (name, dict(rev.meta)))
 
         item = item_registry.get(name, Type(contenttype), rev=rev)
-        logging.debug("ItemClass %r handles %r" % (item.__class__, contenttype))
+        logging.debug("ItemClass {0!r} handles {1!r}".format(item.__class__, contenttype))
         return item
 
     def __init__(self, name, rev=None, contenttype=None):
@@ -238,7 +238,7 @@
             from MoinMoin.converter import default_registry as reg
             input_conv = reg.get(Type(self.contenttype), type_moin_document)
             if not input_conv:
-                raise TypeError("We cannot handle the conversion from %s to the DOM tree" % self.contenttype)
+                raise TypeError("We cannot handle the conversion from {0} to the DOM tree".format(self.contenttype))
             smiley_conv = reg.get(type_moin_document, type_moin_document,
                     icon='smiley')
 
@@ -373,7 +373,7 @@
             new_rev.data.write(content)
             written += len(content)
         else:
-            raise StorageError("unsupported content object: %r" % content)
+            raise StorageError("unsupported content object: {0!r}".format(content))
         return written
 
     def _rename(self, name, comment, action):
@@ -392,7 +392,7 @@
         trash_prefix = u'Trash/' # XXX move to config
         now = time.strftime('%Y-%m-%d %H:%M:%S', time.gmtime())
         # make trash name unique by including timestamp:
-        trashname = u'%s%s (%s UTC)' % (trash_prefix, self.name, now)
+        trashname = u'{0}{1} ({2} UTC)'.format(trash_prefix, self.name, now)
         return self._rename(trashname, comment, action=u'TRASH')
 
     def revert(self):
@@ -557,7 +557,7 @@
 
         unknown_item_group = "unknown items"
         if startswith:
-            startswith = (u'%s' % startswith, u'%s' % startswith.swapcase())
+            startswith = (u'{0}'.format(startswith), u'{0}'.format(startswith.swapcase()))
             if not selected_groups or unknown_item_group in selected_groups:
                 index = [(fullname, relname, contenttype)
                          for fullname, relname, contenttype in index
@@ -596,7 +596,7 @@
         all_item_text = "\n".join(item_info[1] for item_info in all_item_index)
         for fullname, relname, contenttype in index:
             hassubitem = False
-            subitem_name_re = u"^%s/[^/]+$" % re.escape(relname)
+            subitem_name_re = u"^{0}/[^/]+$".format(re.escape(relname))
             regex = re.compile(subitem_name_re, re.UNICODE|re.M)
             if regex.search(all_item_text):
                 hassubitem = True
@@ -654,7 +654,7 @@
     data = property(fget=get_data)
 
     def _render_meta(self):
-        return "<pre>%s</pre>" % escape(self.meta_dict_to_text(self.meta, use_filter=False))
+        return "<pre>{0}</pre>".format(escape(self.meta_dict_to_text(self.meta, use_filter=False)))
 
     def get_templates(self, contenttype=None):
         """ create a list of templates (for some specific contenttype) """
@@ -800,7 +800,7 @@
         :param expected_members: set of expected member file names
         """
         if not name in expected_members:
-            raise StorageError("tried to add unexpected member %r to container item %r" % (name, self.name))
+            raise StorageError("tried to add unexpected member {0!r} to container item {1!r}".format(name, self.name))
         if isinstance(name, unicode):
             name = name.encode('utf-8')
         temp_fname = os.path.join(tempfile.gettempdir(), 'TarContainer_' +
@@ -812,15 +812,15 @@
                 content_length = len(content)
             content = StringIO(content) # we need a file obj
         elif not hasattr(content, 'read'):
-            logging.error("unsupported content object: %r" % content)
-            raise StorageError("unsupported content object: %r" % content)
+            logging.error("unsupported content object: {0!r}".format(content))
+            raise StorageError("unsupported content object: {0!r}".format(content))
         assert content_length >= 0  # we don't want -1 interpreted as 4G-1
         ti.size = content_length
         tf.addfile(ti, content)
         tf_members = set(tf.getnames())
         tf.close()
         if tf_members - expected_members:
-            msg = "found unexpected members in container item %r" % self.name
+            msg = "found unexpected members in container item {0!r}".format(self.name)
             logging.error(msg)
             os.remove(temp_fname)
             raise StorageError(msg)
@@ -935,7 +935,7 @@
         elif content_type == 'image/gif':
             output_type = 'GIF'
         else:
-            raise ValueError("content_type %r not supported" % content_type)
+            raise ValueError("content_type {0!r} not supported".format(content_type))
 
         # revision obj has read() seek() tell(), thus this works:
         image = PILImage.open(self.rev.data)
@@ -1014,7 +1014,7 @@
             # no PIL, we can't do anything, we just call the base class method
             return super(TransformableBitmapImage, self)._render_data_diff(oldrev, newrev)
         url = url_for('frontend.diffraw', item_name=self.name, rev1=oldrev.revid, rev2=newrev.revid)
-        return Markup('<img src="%s" />' % escape(url))
+        return Markup('<img src="{0}" />'.format(escape(url)))
 
     def _render_data_diff_raw(self, oldrev, newrev):
         hash_name = HASH_ALGORITHM
@@ -1035,7 +1035,7 @@
             elif content_type == 'image/gif':
                 output_type = 'GIF'
             else:
-                raise ValueError("content_type %r not supported" % content_type)
+                raise ValueError("content_type {0!r} not supported".format(content_type))
 
             try:
                 oldimage = PILImage.open(oldrev)
@@ -1050,7 +1050,7 @@
                 headers = wikiutil.file_headers(content_type=content_type, content_length=len(data))
                 app.cache.set(cid, (headers, data))
             except (IOError, ValueError) as err:
-                logging.exception("error during PILdiff: %s", err.message)
+                logging.exception("error during PILdiff: {0}".format(err.message))
                 abort(404) # TODO render user friendly error image
         else:
             # XXX TODO check ACL behaviour
@@ -1335,12 +1335,12 @@
             image_map = image_map.replace('%MAPNAME%', mapid)
             # add alt and title tags to areas
             image_map = re.sub(r'href\s*=\s*"((?!%TWIKIDRAW%).+?)"', r'href="\1" alt="\1" title="\1"', image_map)
-            image_map = image_map.replace('%TWIKIDRAW%"', '%s" alt="%s" title="%s"' % (drawing_url, title, title))
+            image_map = image_map.replace('%TWIKIDRAW%"', '{0}" alt="{1}" title="{2}"'.format((drawing_url, title, title)))
             title = _('Clickable drawing: %(filename)s', filename=item_name)
 
-            return Markup(image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid))
+            return Markup(image_map + '<img src="{0}" alt="{1}" usemap="#{2}" />'.format(png_url, title, mapid))
         else:
-            return Markup('<img src="%s" alt="%s" />' % (png_url, title))
+            return Markup('<img src="{0}" alt="{1}" />'.format(png_url, title))
 
 item_registry.register(TWikiDraw._factory, Type('application/x-twikidraw'))
 
@@ -1430,13 +1430,13 @@
             # we have also to set a unique ID
             mapid = 'ImageMapOf' + self.name
             image_map = image_map.replace(u'id="drawing.svg"', '')
-            image_map = image_map.replace(u'name="drawing.svg"', u'name="%s"' % mapid)
+            image_map = image_map.replace(u'name="drawing.svg"', u'name="{0}"'.format(mapid))
             # unxml, because 4.01 concrete will not validate />
             image_map = image_map.replace(u'/>', u'>')
             title = _('Clickable drawing: %(filename)s', filename=self.name)
-            return Markup(image_map + '<img src="%s" alt="%s" usemap="#%s" />' % (png_url, title, mapid))
+            return Markup(image_map + '<img src="{0}" alt="{1}" usemap="#{2}" />'.format(png_url, title, mapid))
         else:
-            return Markup('<img src="%s" alt="%s" />' % (png_url, title))
+            return Markup('<img src="{0}" alt="{1}" />'.format(png_url, title))
 
 item_registry.register(AnyWikiDraw._factory, Type('application/x-anywikidraw'))
 
@@ -1497,7 +1497,7 @@
         item_name = self.name
         drawing_url = url_for('frontend.get_item', item_name=item_name, member='drawing.svg')
         png_url = url_for('frontend.get_item', item_name=item_name, member='drawing.png')
-        return Markup('<img src="%s" alt="%s" />' % (png_url, drawing_url))
+        return Markup('<img src="{0}" alt="{1}" />'.format(png_url, drawing_url))
 
 item_registry.register(SvgDraw._factory, Type('application/x-svgdraw'))
 
--- a/MoinMoin/log.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/log.py	Sun Oct 16 02:26:35 2011 +0200
@@ -106,7 +106,7 @@
 
 def _log_warning(message, category, filename, lineno, file=None, line=None):
     # for warnings, we just want to use the logging system, not stderr or other files
-    msg = "%s:%s: %s: %s" % (filename, lineno, category.__name__, message)
+    msg = "{0}:{1}: {2}: {3}".format(filename, lineno, category.__name__, message)
     logger = getLogger(__name__)
     logger.warning(msg) # Note: the warning will look like coming from here,
                         # but msg contains info about where it really comes from
@@ -123,7 +123,7 @@
             logging.config.fileConfig(conf_fname)
             configured = True
             l = getLogger(__name__)
-            l.info('using logging configuration read from "%s"' % conf_fname)
+            l.info('using logging configuration read from "{0}"'.format(conf_fname))
             warnings.showwarning = _log_warning
         except Exception as err: # XXX be more precise
             err_msg = str(err)
@@ -135,7 +135,7 @@
         configured = True
         l = getLogger(__name__)
         if err_msg:
-            l.warning('load_config for "%s" failed with "%s".' % (conf_fname, err_msg))
+            l.warning('load_config for "{0}" failed with "{1}".'.format(conf_fname, err_msg))
         l.warning('using logging configuration read from built-in fallback in MoinMoin.log module!')
         warnings.showwarning = _log_warning
 
--- a/MoinMoin/macro/Date.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/macro/Date.py	Sun Oct 16 02:26:35 2011 +0200
@@ -41,7 +41,7 @@
                             tzoffset = -tzoffset
                 tm = year, month, day, hour, minute, second, 0, 0, 0
             except ValueError as err:
-                raise ValueError("Bad timestamp %r: %s" % (args, err))
+                raise ValueError("Bad timestamp {0!r}: {1}".format(args, err))
             # as mktime wants a localtime argument (but we only have UTC),
             # we adjust by our local timezone's offset
             try:
@@ -53,7 +53,7 @@
             try:
                 tm = float(args)
             except ValueError as err:
-                raise ValueError("Bad timestamp %r: %s" % (args, err))
+                raise ValueError("Bad timestamp {0!r}: {1}".format(args, err))
         return tm
 
 class Macro(MacroDateTimeBase):
--- a/MoinMoin/macro/MailTo.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/macro/MailTo.py	Sun Oct 16 02:26:35 2011 +0200
@@ -30,12 +30,12 @@
         if flaskg.user.valid:
             # decode address and generate mailto: link
             email = decodeSpamSafeEmail(email)
-            result = moin_page.a(attrib={xlink.href: u'mailto:%s' % email}, children=[text or email])
+            result = moin_page.a(attrib={xlink.href: u'mailto:{0}'.format(email)}, children=[text or email])
         else:
             # unknown user, maybe even a spambot, so just return text as given in macro args
             if text:
                 text += " "
-            result = moin_page.code(children=[text, "<%s>" % email])
+            result = moin_page.code(children=[text, "<{0}>".format(email)])
 
         return result
 
--- a/MoinMoin/macro/PagenameList.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/macro/PagenameList.py	Sun Oct 16 02:26:35 2011 +0200
@@ -27,7 +27,7 @@
             try:
                 needle_re = re.compile(needle, re_flags)
             except re.error as err:
-                raise ValueError("Error in regex %r: %s" % (needle, err))
+                raise ValueError("Error in regex {0!r}: {1}".format(needle, err))
         else:
             needle_re = re.compile(re.escape(needle), re_flags)
 
--- a/MoinMoin/macro/_base.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/macro/_base.py	Sun Oct 16 02:26:35 2011 +0200
@@ -79,7 +79,7 @@
         """ creates an ET with a list of pagelinks from a list of pagenames """
         num_page_list = moin_page.list(attrib={moin_page.item_label_generate: ordered and 'ordered' or 'unordered'})
         for num, pagename in num_pagenames:
-            num_code = moin_page.code(children=["%6d " % num])
+            num_code = moin_page.code(children=["{0:6d} ".format(num)])
             # This link can never reach pagelinks
             url = unicode(iri.Iri(scheme=u'wiki', authority=u'', path=u'/' + pagename))
             pagelink = moin_page.a(attrib={xlink.href: url}, children=[pagename])
--- a/MoinMoin/mail/sendmail.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/mail/sendmail.py	Sun Oct 16 02:26:35 2011 +0200
@@ -50,7 +50,7 @@
         blanks = match.group('blanks')
         addr = match.group('addr')
         if phrase:
-            return "%s%s<%s>" % (str(phrase), str(blanks), str(addr))
+            return "{0!s}{1!s}<{2!s}>".format(phrase, blanks, addr)
         else:
             return str(addr)
     else:
@@ -79,8 +79,8 @@
     cfg = app.cfg
     mail_from = mail_from or cfg.mail_from
 
-    logging.debug("send mail, from: %r, subj: %r" % (mail_from, subject))
-    logging.debug("send mail, to: %r" % (to, ))
+    logging.debug("send mail, from: {0!r}, subj: {1!r}".format(mail_from, subject))
+    logging.debug("send mail, to: {0!r}".format(to))
 
     if not to:
         return (1, _("No recipients, nothing to do"))
@@ -128,7 +128,7 @@
     # Send the message
     if not cfg.mail_sendmail:
         try:
-            logging.debug("trying to send mail (smtp) via smtp server '%s'" % cfg.mail_smarthost)
+            logging.debug("trying to send mail (smtp) via smtp server '{0}'".format(cfg.mail_smarthost))
             host, port = (cfg.mail_smarthost + ':25').split(':')[:2]
             server = smtplib.SMTP(host, int(port))
             try:
@@ -142,7 +142,7 @@
                             logging.debug("tls connection to smtp server established")
                     except:
                         logging.debug("could not establish a tls connection to smtp server, continuing without tls")
-                    logging.debug("trying to log in to smtp server using account '%s'" % cfg.mail_username)
+                    logging.debug("trying to log in to smtp server using account '{0}'".format(cfg.mail_username))
                     server.login(cfg.mail_username, cfg.mail_password)
                 server.sendmail(mail_from, to, msg.as_string())
             finally:
@@ -168,7 +168,7 @@
             sendmailp.write(msg.as_string())
             sendmail_status = sendmailp.close()
             if sendmail_status:
-                logging.error("sendmail failed with status: %s" % str(sendmail_status))
+                logging.error("sendmail failed with status: {0!s}".format(sendmail_status))
                 return (0, str(sendmail_status))
         except:
             logging.exception("sendmail failed with an exception.")
@@ -195,10 +195,10 @@
     address = email_address.lower()
     # uppercase letters will be stripped by decodeSpamSafeEmail
     for word, sign in _transdict.items():
-        address = address.replace(sign, ' %s ' % word)
+        address = address.replace(sign, ' {0} '.format(word))
     if obfuscation_text.isalpha():
         # is the obfuscation_text alphabetic
-        address = address.replace(' AT ', ' AT %s ' % obfuscation_text.upper())
+        address = address.replace(' AT ', ' AT {0} '.format(obfuscation_text.upper()))
 
     return address
 
--- a/MoinMoin/script/account/disable.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/account/disable.py	Sun Oct 16 02:26:35 2011 +0200
@@ -37,15 +37,15 @@
             u = user.User(auth_username=name)
 
         if not u.exists():
-            print 'This user "%s" does not exists!' % u.name
+            print 'This user "{0}" does not exists!'.format(u.name)
             return
 
-        print " %-20s %-25s %-35s" % (u.id, u.name, u.email),
+        print " {0:<20} {1:<25} {2:<35}".format(u.id, u.name, u.email),
         if not u.disabled: # only disable once
             u.disabled = 1
-            u.name = "%s-%s" % (u.name, u.id)
+            u.name = "{0}-{1}".format(u.name, u.id)
             if u.email:
-                u.email = "%s-%s" % (u.email, u.id)
+                u.email = "{0}-{1}".format(u.email, u.id)
             u.subscribed_items = [] # avoid using email
             u.save()
             print "- disabled."
--- a/MoinMoin/script/account/resetpw.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/account/resetpw.py	Sun Oct 16 02:26:35 2011 +0200
@@ -41,7 +41,7 @@
             u = user.User(auth_username=name)
 
         if not u.exists():
-            print 'This user "%s" does not exists!' % u.name
+            print 'This user "{0}" does not exists!'.format(u.name)
             return
 
         u.enc_password = crypto.crypt_password(password)
--- a/MoinMoin/script/maint/index.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/maint/index.py	Sun Oct 16 02:26:35 2011 +0200
@@ -101,7 +101,7 @@
 
     def run(self, tmp):
         for idx_name in [LATEST_REVS, ALL_REVS]:
-            print " %s %s %s" % ("-" * 10, idx_name, "-" * 60)
+            print " {0} {1} {2}".format("-" * 10, idx_name, "-" * 60)
             for kvs in app.storage.dump(tmp=tmp, idx_name=idx_name):
                 for k, v in kvs:
                     print k, repr(v)[:70]
--- a/MoinMoin/script/maint/reduce_revisions.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/maint/reduce_revisions.py	Sun Oct 16 02:26:35 2011 +0200
@@ -38,7 +38,7 @@
             for revno in item.list_revisions():
                 if revno < current_revno:
                     rev = item.get_revision(revno)
-                    print "Destroying %r revision %d." % (item_name, revno)
+                    print "Destroying {0!r} revision {1}.".format(item_name, revno)
                     rev.destroy()
 
         print "Finished reducing backend."
--- a/MoinMoin/script/maint/set_meta.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/maint/set_meta.py	Sun Oct 16 02:26:35 2011 +0200
@@ -71,9 +71,9 @@
             if not remove:
                 # Set or overwrite given metadata key with text
                 next_rev[key] = literal_eval(value)
-                print "Processing %r, setting %s=%r." % (item_name, key, value)
+                print "Processing {0!r}, setting {1}={2!r}.".format(item_name, key, value)
             else:
-                print "Processing %r, removing %s." % (item_name, key)
+                print "Processing {0!r}, removing {1}.".format(item_name, key)
 
             item.commit()
 
--- a/MoinMoin/script/migration/moin19/_logfile19.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/migration/moin19/_logfile19.py	Sun Oct 16 02:26:35 2011 +0200
@@ -48,7 +48,7 @@
         self.loglevel = logging.NOTSET
         if forward:
             begin = offset
-            logging.log(self.loglevel, "LineBuffer.init: forward seek %d read %d" % (begin, size))
+            logging.log(self.loglevel, "LineBuffer.init: forward seek {0} read {1}".format(begin, size))
             file.seek(begin)
             lines = file.readlines(size)
         else:
@@ -57,7 +57,7 @@
                 size = offset
             else:
                 begin = offset - size
-            logging.log(self.loglevel, "LineBuffer.init: backward seek %d read %d" % (begin, size))
+            logging.log(self.loglevel, "LineBuffer.init: backward seek {0} read {1}".format(begin, size))
             file.seek(begin)
             lines = file.read(size).splitlines(True)
             if begin != 0:
@@ -118,7 +118,7 @@
         self.to_end()
         while True:
             try:
-                logging.log(self.loglevel, "LogFile.reverse %s" % self.__filename)
+                logging.log(self.loglevel, "LogFile.reverse {0}".format(self.__filename))
                 result = self.previous()
             except StopIteration:
                 return
@@ -130,7 +130,7 @@
         :rtype: string (error message) or None
         """
         if not os.access(self.__filename, os.W_OK):
-            return "The log '%s' is not writable!" % (self.__filename, )
+            return "The log '{0}' is not writable!".format(self.__filename)
         return None
 
     def __getattr__(self, name):
@@ -161,7 +161,7 @@
                     f.close()
                     self._input = file(self.__filename, "rb", )
                 else:
-                    logging.error("logfile: %r IOERROR errno %d (%s)" % (self.__filename, err.errno, os.strerror(err.errno)))
+                    logging.error("logfile: {0!r} IOERROR errno {1} ({2})".format(self.__filename, err.errno, os.strerror(err.errno)))
                     raise
             return self._input
         elif name == "_output":
@@ -220,7 +220,7 @@
         :returns: True if moving more than to the beginning and moving
                  to the end or beyond
         """
-        logging.log(self.loglevel, "LogFile.peek %s" % self.__filename)
+        logging.log(self.loglevel, "LogFile.peek {0}".format(self.__filename))
         self.__rel_index += lines
         while self.__rel_index < 0:
             if self.__buffer is self.__buffer2:
@@ -292,7 +292,7 @@
         result = None
         while result is None:
             while result is None:
-                logging.log(self.loglevel, "LogFile.next %s" % self.__filename)
+                logging.log(self.loglevel, "LogFile.next {0}".format(self.__filename))
                 result = self.__next()
             if self.filter and not self.filter(result):
                 result = None
@@ -312,7 +312,7 @@
         result = None
         while result is None:
             while result is None:
-                logging.log(self.loglevel, "LogFile.previous %s" % self.__filename)
+                logging.log(self.loglevel, "LogFile.previous {0}".format(self.__filename))
                 result = self.__previous()
             if self.filter and not self.filter(result):
                 result = None
@@ -320,7 +320,7 @@
 
     def to_begin(self):
         """moves file position to the begin"""
-        logging.log(self.loglevel, "LogFile.to_begin %s" % self.__filename)
+        logging.log(self.loglevel, "LogFile.to_begin {0}".format(self.__filename))
         if self.__buffer1 is None or self.__buffer1.offsets[0] != 0:
             self.__buffer1 = LineBuffer(self._input,
                                         0,
@@ -334,7 +334,7 @@
 
     def to_end(self):
         """moves file position to the end"""
-        logging.log(self.loglevel, "LogFile.to_end %s" % self.__filename)
+        logging.log(self.loglevel, "LogFile.to_end {0}".format(self.__filename))
         self._input.seek(0, 2) # to end of file
         size = self._input.tell()
         if self.__buffer2 is None or size > self.__buffer2.offsets[-1]:
@@ -365,11 +365,11 @@
         .seek is much more efficient for moving long distances than .peek.
         raises ValueError if position is invalid
         """
-        logging.log(self.loglevel, "LogFile.seek %s pos %d" % (self.__filename, position))
+        logging.log(self.loglevel, "LogFile.seek {0} pos {1}".format(self.__filename, position))
         if self.__buffer1:
-            logging.log(self.loglevel, "b1 %r %r" % (self.__buffer1.offsets[0], self.__buffer1.offsets[-1]))
+            logging.log(self.loglevel, "b1 {0!r} {1!r}".format(self.__buffer1.offsets[0], self.__buffer1.offsets[-1]))
         if self.__buffer2:
-            logging.log(self.loglevel, "b2 %r %r" % (self.__buffer2.offsets[0], self.__buffer2.offsets[-1]))
+            logging.log(self.loglevel, "b2 {0!r} {1!r}".format(self.__buffer2.offsets[0], self.__buffer2.offsets[-1]))
         if self.__buffer1 and self.__buffer1.offsets[0] <= position < self.__buffer1.offsets[-1]:
             # position is in .__buffer1
             self.__rel_index = self.__buffer1.offsets.index(position)
--- a/MoinMoin/script/migration/moin19/_utils19.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/migration/moin19/_utils19.py	Sun Oct 16 02:26:35 2011 +0200
@@ -44,7 +44,7 @@
             if not comment.startswith(' '):
                 # we don't require a blank after the ##, so we put one there
                 comment = ' ' + comment
-                line = '##%s' % comment
+                line = '##{0}'.format(comment)
 
         verb, args = (line[1:] + ' ').split(' ', 1) # split at the first blank
         pi.setdefault(verb.lower(), []).append(args.strip())
@@ -76,9 +76,9 @@
         # special handling for list metadata
         if isinstance(value, (list, tuple)):
             for line in value:
-                metadata_data += "#%s %s\n" % (key, line)
+                metadata_data += "#{0} {1}\n".format(key, line)
         else:
-            metadata_data += "#%s %s\n" % (key, value)
+            metadata_data += "#{0} {1}\n".format(key, value)
     return metadata_data + data
 
 
@@ -105,7 +105,7 @@
         # Quote and append unsafe stuff
         quoted.append('(')
         for character in needle.group():
-            quoted.append('%02x' % ord(character))
+            quoted.append("{0:02x}".format(ord(character)))
         quoted.append(')')
 
     # append rest of string
--- a/MoinMoin/script/migration/moin19/import19.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/script/migration/moin19/import19.py	Sun Oct 16 02:26:35 2011 +0200
@@ -98,7 +98,7 @@
                     meta[USERID] = userid_map[meta[USERID]]
                 except KeyError:
                     # user profile lost, but userid referred by revision
-                    print "lost %r" % meta[USERID]
+                    print "lost {0!r}".format(meta[USERID])
                     del meta[USERID]
                 backend.store(meta, data)
             elif meta.get(CONTENTTYPE) == CONTENTTYPE_USER:
@@ -150,7 +150,7 @@
             try:
                 item = PageItem(self, os.path.join(pages_dir, f), itemname)
             except Exception as err:
-                logging.exception("PageItem %r raised exception:" % itemname)
+                logging.exception("PageItem {0!r} raised exception:".format(itemname))
             else:
                 for rev in item.iter_revisions():
                     yield rev
@@ -174,7 +174,7 @@
         self.acl = None # TODO
         self.itemid = make_uuid()
         if backend.deleted_mode == DELETED_MODE_KILL:
-            revpath = os.path.join(self.path, 'revisions', '%08d' % self.current)
+            revpath = os.path.join(self.path, 'revisions', '{0:08d}'.format(self.current))
             PageRevision(self, self.current, revpath) # will raise exception if killing is requested
 
     def iter_revisions(self):
@@ -189,7 +189,7 @@
                 revno = int(fname)
                 yield PageRevision(self, revno, os.path.join(revisionspath, fname))
             except Exception as err:
-                logging.exception("PageRevision %r %r raised exception:" % (self.name, fname))
+                logging.exception("PageRevision {0!r} {1!r} raised exception:".format(self.name, fname))
 
     def iter_attachments(self):
         attachmentspath = os.path.join(self.path, 'attachments')
@@ -202,7 +202,7 @@
             try:
                 yield AttachmentRevision(self.name, attachname, os.path.join(attachmentspath, fname), self.editlog, self.acl)
             except Exception as err:
-                logging.exception("AttachmentRevision %r/%r raised exception:" % (self.name, attachname))
+                logging.exception("AttachmentRevision {0!r}/{1!r} raised exception:".format(self.name, attachname))
 
 
 class PageRevision(object):
@@ -247,8 +247,7 @@
                         ACTION: u'SAVE/DELETE',
                     }
                 else:
-                    raise NoSuchRevisionError('Item %r has no revision %d (not even a deleted one)!' %
-                            (item.name, revno))
+                    raise NoSuchRevisionError('Item {0!r} has no revision {1} (not even a deleted one)!'.format(item.name, revno))
         else:
             try:
                 editlog_data = editlog.find_rev(revno)
@@ -333,7 +332,7 @@
                 MTIME: int(os.path.getmtime(attpath)),
                 ACTION: u'SAVE',
             }
-        meta[NAME] = u'%s/%s' % (item_name, attach_name)
+        meta[NAME] = u'{0}/{1}'.format(item_name, attach_name)
         if acl is not None:
             meta[ACL] = acl
         meta[CONTENTTYPE] = unicode(MimeType(filename=attach_name).content_type())
@@ -426,13 +425,13 @@
         if (entries, rights) == (['Default'], []):
             result.append("Default")
         else:
-            result.append("%s%s:%s" % (
+            result.append("{0}{1}:{2}".format(
                           modifier,
                           u','.join(entries),
                           u','.join(rights) # iterator has removed invalid rights
                          ))
     result = u' '.join(result)
-    logging.debug("regenerate_acl %r -> %r" % (acl_string, result))
+    logging.debug("regenerate_acl {0!r} -> {1!r}".format(acl_string, result))
     return result
 
 
@@ -587,7 +586,7 @@
                 try:
                     rev = UserRevision(self.path, uid)
                 except Exception as err:
-                    logging.exception("Exception in user item processing %s" % uid)
+                    logging.exception("Exception in user item processing {0}".format(uid))
                 else:
                     yield rev
 
@@ -606,6 +605,6 @@
         hash.update(content)
         size = len(content)
     else:
-        raise ValueError("unsupported content object: %r" % content)
+        raise ValueError("unsupported content object: {0!r}".format(content))
     return size, HASH_ALGORITHM, unicode(hash.hexdigest())
 
--- a/MoinMoin/search/analyzers.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/search/analyzers.py	Sun Oct 16 02:26:35 2011 +0200
@@ -31,7 +31,7 @@
             instead of 0,1,2,...
         :param positions: Whether to record token positions in the token.
         """
-        assert isinstance(value, unicode), "%r is not unicode" % value
+        assert isinstance(value, unicode), "{0!r} is not unicode".format(value)
         if u'/' not in value: # Add '/' if user forgot do this
             value += u'/'
         pos = start_pos
@@ -59,7 +59,7 @@
                 pos += 1
             yield tk
         for key, value in tp.parameters.items():
-            tk.text = u"%s=%s" % (key, value)
+            tk.text = u"{0}={1}".format(key, value)
             if positions:
                 tk.pos = pos
                 pos += 1
@@ -114,7 +114,7 @@
             for name, permissions in acl.acl:
                 for permission in permissions:
                     sign = "+" if permissions[permission] else "-"
-                    tk.text = u"%s:%s%s" % (name, sign, permission)
+                    tk.text = u"{0}:{1}{2}".format(name, sign, permission)
                     if positions:
                         tk.pos = pos
                         pos += 1
--- a/MoinMoin/security/_tests/test_security.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/security/_tests/test_security.py	Sun Oct 16 02:26:35 2011 +0200
@@ -316,7 +316,7 @@
 
             def _have_right(u, right, itemname):
                 can_access = getattr(u.may, right)(itemname)
-                assert can_access, "%r may %s %r (normal)" % (u.name, right, itemname)
+                assert can_access, "{0!r} may {1} {2!r} (normal)".format(u.name, right, itemname)
 
             # User should have these rights...
             for right in may:
@@ -324,7 +324,7 @@
 
             def _not_have_right(u, right, itemname):
                 can_access = getattr(u.may, right)(itemname)
-                assert not can_access, "%r may not %s %r (normal)" % (u.name, right, itemname)
+                assert not can_access, "{0!r} may not {1} {2!r} (normal)".format(u.name, right, itemname)
 
             # User should NOT have these rights:
             mayNot = [right for right in app.cfg.acl_rights_contents
@@ -394,7 +394,7 @@
 
             def _have_right(u, right, itemname):
                 can_access = getattr(u.may, right)(itemname)
-                assert can_access, "%r may %s %r (hierarchic)" % (u.name, right, itemname)
+                assert can_access, "{0!r} may {1} {2!r} (hierarchic)".format(u.name, right, itemname)
 
             # User should have these rights...
             for right in may:
@@ -402,7 +402,7 @@
 
             def _not_have_right(u, right, itemname):
                 can_access = getattr(u.may, right)(itemname)
-                assert not can_access, "%r may not %s %r (hierarchic)" % (u.name, right, itemname)
+                assert not can_access, "{0!r} may not {1} {2!r} (hierarchic)".format(u.name, right, itemname)
 
             # User should NOT have these rights:
             mayNot = [right for right in app.cfg.acl_rights_contents
--- a/MoinMoin/security/textcha.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/security/textcha.py	Sun Oct 16 02:26:35 2011 +0200
@@ -69,13 +69,13 @@
         if textchas and not user.may.notextcha():
             locales = [user.locale, cfg.locale_default, 'en', ]
             for locale in locales:
-                logging.debug(u"TextCha: trying locale == '%s'." % locale)
+                logging.debug(u"TextCha: trying locale == '{0}'.".format(locale))
                 if locale in textchas:
-                    logging.debug(u"TextCha: using locale = '%s'" % locale)
+                    logging.debug(u"TextCha: using locale = '{0}'".format(locale))
                     return textchas[locale]
 
     def _compute_signature(self, question, timestamp):
-        return hmac.new(self.secret, "%s%d" % (question, timestamp), digestmod=hashlib.sha1).hexdigest()
+        return hmac.new(self.secret, "{0}{1}".format(question, int(timestamp)), digestmod=hashlib.sha1).hexdigest()
 
     def init_qa(self, question=None):
         """ Initialize the question / answer.
@@ -117,10 +117,9 @@
                 # this question does not exist, thus there is no answer
                 self.answer_regex = ur"[Invalid question]"
                 self.answer_re = None
-                logging.warning(u"TextCha: Non-existing question '%s' for %s. May be invalid or user may be trying to cheat." % (
-                                self.question, self.user_info))
+                logging.warning(u"TextCha: Non-existing question '{0}' for {1}. May be invalid or user may be trying to cheat.".format(self.question, self.user_info))
             except re.error:
-                logging.error(u"TextCha: Invalid regex in answer for question '%s'" % self.question)
+                logging.error(u"TextCha: Invalid regex in answer for question '{0}'".format(self.question))
                 self.init_qa()
 
     def is_enabled(self):
@@ -148,7 +147,7 @@
         """
         if self.is_enabled():
             if self.question:
-                self.form['textcha_question'].set("%s %d%s" % (self.question, self.timestamp, self.signature))
+                self.form['textcha_question'].set("{0} {1}{2}".format(self.question, int(self.timestamp), self.signature))
         else:
             self.form['textcha_question'].optional = True
             self.form['textcha'].optional = True
--- a/MoinMoin/security/ticket.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/security/ticket.py	Sun Oct 16 02:26:35 2011 +0200
@@ -28,7 +28,7 @@
     """
     if tm is None:
         # for age-check of ticket
-        tm = "%010x" % time.time()
+        tm = "{0:010x}".format(int(time.time()))
 
     kw['uid'] = flaskg.user.valid and flaskg.user.itemid or ''
 
@@ -42,7 +42,7 @@
 
     h = hmac.new(app.cfg.secrets['security/ticket'],
                  ''.join(hmac_data), digestmod=hashlib.sha1)
-    return "%s.%s" % (tm, h.hexdigest())
+    return "{0}.{1}".format(tm, h.hexdigest())
 
 
 def checkTicket(ticket, **kw):
@@ -55,13 +55,13 @@
         timestamp_str = ticket.split('.')[0]
         timestamp = int(timestamp_str, 16)
     except ValueError:
-        logging.debug("checkTicket: invalid or empty ticket %r" % ticket)
+        logging.debug("checkTicket: invalid or empty ticket {0!r}".format(ticket))
         return False
     now = time.time()
     if timestamp < now - 10 * 3600:
-        logging.debug("checkTicket: too old ticket, timestamp %r" % timestamp)
+        logging.debug("checkTicket: too old ticket, timestamp {0!r}".format(timestamp))
         return False
     ourticket = createTicket(timestamp_str, **kw)
-    logging.debug("checkTicket: returning %r, got %r, expected %r" % (ticket == ourticket, ticket, ourticket))
+    logging.debug("checkTicket: returning {0!r}, got {1!r}, expected {2!r}".format(ticket == ourticket, ticket, ourticket))
     return ticket == ourticket
 
--- a/MoinMoin/signalling/log.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/signalling/log.py	Sun Oct 16 02:26:35 2011 +0200
@@ -15,9 +15,9 @@
 @item_displayed.connect_via(ANY)
 def log_item_displayed(app, item_name):
     wiki_name = app.cfg.interwikiname
-    logging.info("item %s:%s displayed" % (wiki_name, item_name))
+    logging.info("item {0}:{1} displayed".format(wiki_name, item_name))
 
 @item_modified.connect_via(ANY)
 def log_item_modified(app, item_name):
     wiki_name = app.cfg.interwikiname
-    logging.info("item %s:%s modified" % (wiki_name, item_name))
+    logging.info("item {0}:{1} modified".format(wiki_name, item_name))
--- a/MoinMoin/storage/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -33,7 +33,7 @@
     """
     backend_name_uri = uri.split(':', 1)
     if len(backend_name_uri) != 2:
-        raise ValueError("malformed backend uri: %s" % backend_uri)
+        raise ValueError("malformed backend uri: {0}".format(backend_uri))
     backend_name, backend_uri = backend_name_uri
     module = __import__(BACKENDS_PACKAGE + '.' + backend_name, globals(), locals(), ['MutableBackend', ])
     return module.MutableBackend.from_uri(backend_uri)
--- a/MoinMoin/storage/backends/fileserver.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/backends/fileserver.py	Sun Oct 16 02:26:35 2011 +0200
@@ -110,8 +110,8 @@
                 u"= Directory contents =",
                 u" * [[../]]",
             ]
-            content.extend(u" * [[/%s|%s/]]" % (name, name) for name in sorted(dirs))
-            content.extend(u" * [[/%s|%s]]" % (name, name) for name in sorted(files))
+            content.extend(u" * [[/{0}|{1}/]]".format(name, name) for name in sorted(dirs))
+            content.extend(u" * [[/{0}|{1}]]".format(name, name) for name in sorted(files))
             content.append(u"")
             content = u'\r\n'.join(content)
         except OSError as err:
--- a/MoinMoin/storage/backends/stores.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/backends/stores.py	Sun Oct 16 02:26:35 2011 +0200
@@ -43,7 +43,7 @@
     def from_uri(cls, uri):
         store_name_uri = uri.split(':', 1)
         if len(store_name_uri) != 2:
-            raise ValueError("malformed store uri: %s" % uri)
+            raise ValueError("malformed store uri: {0}".format(uri))
         store_name, store_uri = store_name_uri
         module = __import__(STORES_PACKAGE + '.' + store_name, globals(), locals(), ['BytesStore', 'FileStore', ])
         meta_store_uri = store_uri % dict(kind='meta')
@@ -139,14 +139,12 @@
             size_expected = meta.get(SIZE)
             size_real = tfw.size
             if size_expected is not None and size_expected != size_real:
-                raise ValueError("computed data size (%d) does not match data size declared in metadata (%d)" % (
-                                 size_real, size_expected))
+                raise ValueError("computed data size ({0}) does not match data size declared in metadata ({1})".format(size_real, size_expected))
             meta[SIZE] = size_real
             hash_expected = meta.get(HASH_ALGORITHM)
             hash_real = tfw.hash.hexdigest()
             if hash_expected is not None and hash_expected != hash_real:
-                raise ValueError("computed data hash (%s) does not match data hash declared in metadata (%s)" % (
-                                 hash_real, hash_expected))
+                raise ValueError("computed data hash ({0}) does not match data hash declared in metadata ({1})".format(hash_real, hash_expected))
             meta[HASH_ALGORITHM] = hash_real
         else:
             dataid = meta[DATAID]
--- a/MoinMoin/storage/middleware/_tests/test_indexing.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/middleware/_tests/test_indexing.py	Sun Oct 16 02:26:35 2011 +0200
@@ -390,7 +390,7 @@
         item_name = u'foo'
         item = self.imw[item_name]
         for i in xrange(100):
-            item.store_revision(dict(name=item_name, acl=u'joe:create joe:read'), StringIO('rev number %d' % i))
+            item.store_revision(dict(name=item_name, acl=u'joe:create joe:read'), StringIO('rev number {0}'.format(i)))
         for r in item.iter_revs():
             #print r.meta
             #print r.data.read()
--- a/MoinMoin/storage/middleware/indexing.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/middleware/indexing.py	Sun Oct 16 02:26:35 2011 +0200
@@ -177,10 +177,10 @@
             doc = output_conv(doc)
             return doc
         # no way
-        raise TypeError("No converter for %s --> %s" % (input_contenttype, output_contenttype))
+        raise TypeError("No converter for {0} --> {1}".format(input_contenttype, output_contenttype))
     except Exception as e: # catch all exceptions, we don't want to break an indexing run
-        logging.exception("Exception happened in conversion of item %r rev %s contenttype %s:" % (meta[NAME], meta.get(REVID, 'new'), meta.get(CONTENTTYPE, '')))
-        doc = u'ERROR [%s]' % str(e)
+        logging.exception("Exception happened in conversion of item {0!r} rev {1} contenttype {2}:".format(meta[NAME], meta.get(REVID, 'new'), meta.get(CONTENTTYPE, '')))
+        doc = u'ERROR [{0!s}]'.format(e)
         return doc
 
 
@@ -289,7 +289,7 @@
             for name in INDEXES:
                 self.ix[name] = open_dir(index_dir, indexname=name)
         except (IOError, OSError, EmptyIndexError) as err:
-            logging.error(u"%s [while trying to open index '%s' in '%s']" % (str(err), name, index_dir))
+            logging.error(u"{0!s} [while trying to open index '{1}' in '{2}']".format(err, name, index_dir))
             raise
 
     def close(self):
@@ -315,7 +315,7 @@
             for name in INDEXES:
                 create_in(index_dir, self.schemas[name], indexname=name)
         except (IOError, OSError) as err:
-            logging.error(u"%s [while trying to create index '%s' in '%s']" % (str(err), name, index_dir))
+            logging.error(u"{0!s} [while trying to create index '{1}' in '{2}']".format(err, name, index_dir))
             raise
 
     def destroy(self, tmp=False):
@@ -427,7 +427,7 @@
                 elif mode == 'delete':
                     writer.delete_by_term(REVID, revid)
                 else:
-                    raise ValueError("mode must be 'update', 'add' or 'delete', not '%s'" % mode)
+                    raise ValueError("mode must be 'update', 'add' or 'delete', not '{0}'".format(mode))
 
     def _find_latest_revids(self, index, query=None):
         """
@@ -911,5 +911,5 @@
         return 0 # XXX
 
     def __repr__(self):
-        return "Meta _doc: %r _meta: %r" % (self._doc, self._meta)
+        return "Meta _doc: {0!r} _meta: {1!r}".format(self._doc, self._meta)
 
--- a/MoinMoin/storage/middleware/protecting.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/middleware/protecting.py	Sun Oct 16 02:26:35 2011 +0200
@@ -45,7 +45,7 @@
             if itemname.startswith(prefix):
                 return acls
         else:
-            raise ValueError('No acl_mapping entry found for item %r' % itemname)
+            raise ValueError('No acl_mapping entry found for item {0!r}'.format(itemname))
 
     def query_parser(self, default_fields, idx_name=LATEST_REVS):
         return self.indexer.query_parser(default_fields, idx_name=idx_name)
@@ -197,7 +197,7 @@
 
     def require(self, capability):
         if not self.allows(capability):
-            raise AccessDenied("item does not allow user '%r' to '%r'" % (self.protector.user.name, capability))
+            raise AccessDenied("item does not allow user '{0!r}' to '{1!r}'".format(self.protector.user.name, capability))
 
     def iter_revs(self):
         self.require(READ)
@@ -252,7 +252,7 @@
 
     def require(self, capability):
         if not self.allows(capability):
-            raise AccessDenied("revision does not allow '%r'" % (capability, ))
+            raise AccessDenied("revision does not allow '{0!r}'".format(capability))
 
     @property
     def revid(self):
--- a/MoinMoin/storage/middleware/routing.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/middleware/routing.py	Sun Oct 16 02:26:35 2011 +0200
@@ -66,21 +66,21 @@
             if itemname == mountpoint or itemname.startswith(mountpoint and mountpoint + '/' or ''):
                 lstrip = mountpoint and len(mountpoint)+1 or 0
                 return backend, itemname[lstrip:], mountpoint
-        raise AssertionError("No backend found for %r. Available backends: %r" % (itemname, self.mapping))
+        raise AssertionError("No backend found for {0!r}. Available backends: {1!r}".format(itemname, self.mapping))
 
     def __iter__(self):
         # Note: yields <backend_mountpoint>/<backend_revid> as router revid, so that this
         #       can be given to get_revision and be routed to the right backend.
         for mountpoint, backend in self.mapping:
             for revid in backend:
-                yield u'%s:%s' % (mountpoint, revid)
+                yield u'{0}:{1}'.format(mountpoint, revid)
 
     def retrieve(self, revid):
         mountpoint, revid = revid.rsplit(u':', 1)
         backend = self._get_backend(mountpoint)[0]
         meta, data = backend.retrieve(revid)
         if mountpoint:
-            meta[NAME] = u'%s/%s' % (mountpoint, meta[NAME])
+            meta[NAME] = u'{0}/{1}'.format(mountpoint, meta[NAME])
         return meta, data
 
     # writing part
@@ -100,16 +100,14 @@
         itemname = meta[NAME]
         backend, itemname, mountpoint = self._get_backend(itemname)
         if not isinstance(backend, MutableBackendBase):
-            raise TypeError('backend %r mounted at %r is readonly' % (
-                backend, mountpoint))
+            raise TypeError('backend {0!r} mounted at {1!r} is readonly'.format(backend, mountpoint))
         meta[NAME] = itemname
-        return u'%s:%s' % (mountpoint, backend.store(meta, data))
+        return u'{0}:{1}'.format(mountpoint, backend.store(meta, data))
 
     def remove(self, revid):
         mountpoint, revid = revid.rsplit(u':', 1)
         backend = self._get_backend(mountpoint)[0]
         if not isinstance(backend, MutableBackendBase):
-            raise TypeError('backend %r mounted at %r is readonly' % (
-                backend, mountpoint))
+            raise TypeError('backend {0!r} mounted at {1!r} is readonly'.format(backend, mountpoint))
         backend.remove(revid)
 
--- a/MoinMoin/storage/stores/_tests/conftest.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/stores/_tests/conftest.py	Sun Oct 16 02:26:35 2011 +0200
@@ -32,7 +32,7 @@
                                           'test_table', compression_level=1),
     'kc': lambda store, tmpdir: store(str(tmpdir.join('store.kch'))),
     'kt': lambda store, _: store(),
-    'sqla': lambda store, tmpdir: store('sqlite:///%s' % str(tmpdir.join('store.sqlite')),
+    'sqla': lambda store, tmpdir: store('sqlite:///{0!s}'.format(tmpdir.join('store.sqlite')),
                                         'test_table'),
 }
 
@@ -53,7 +53,7 @@
         for storename in STORES:
             for klass in klasses:
                 metafunc.addcall(
-                    id='%s/%s' % (storename, klass),
+                    id='{0}/{1}'.format(storename, klass),
                     param=(storename, klass))
 
     multi_mark = getattr(metafunc.function, 'multi', None)
@@ -73,7 +73,7 @@
     klass = getattr(storemodule, kind)
     construct = constructors.get(storename)
     if construct is None:
-        pytest.xfail('don\'t know how to construct %s store' % (storename, ))
+        pytest.xfail('don\'t know how to construct {0} store'.format(storename))
     store = construct(klass, tmpdir)
     store.create()
     store.open()
--- a/MoinMoin/storage/stores/_tests/test_sqla.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/stores/_tests/test_sqla.py	Sun Oct 16 02:26:35 2011 +0200
@@ -16,7 +16,7 @@
 def test_create(tmpdir, Store):
     dbfile = tmpdir.join('store.sqlite')
     assert not dbfile.check()
-    store = Store('sqlite:///%s' % str(dbfile))
+    store = Store('sqlite:///{0!s}'.format(dbfile))
     assert not dbfile.check()
     store.create()
     assert dbfile.check()
--- a/MoinMoin/storage/stores/kt.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/stores/kt.py	Sun Oct 16 02:26:35 2011 +0200
@@ -60,7 +60,7 @@
         # note: we use rpc for some stuff that is not possible with restful interface
         # like iteration over keys, or for stuff that is simpler with rpc.
         kw = dict([(k, v) for k, v in kw.items() if v is not None])
-        path_qs = '/rpc/%s?%s' % (method, urllib.urlencode(kw))
+        path_qs = '/rpc/{0}?{1}'.format(method, urllib.urlencode(kw))
         # we use GET with url args, it is simpler and enough for our purposes:
         self.client.request("GET", path_qs)
         response = self.client.getresponse()
--- a/MoinMoin/storage/stores/sqlite.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/storage/stores/sqlite.py	Sun Oct 16 02:26:35 2011 +0200
@@ -48,12 +48,12 @@
     def create(self):
         conn = connect(self.db_name)
         with conn:
-            conn.execute('create table %s (key text primary key, value blob)' % self.table_name)
+            conn.execute('create table {0} (key text primary key, value blob)'.format(self.table_name))
 
     def destroy(self):
         conn = connect(self.db_name)
         with conn:
-            conn.execute('drop table %s' % self.table_name)
+            conn.execute('drop table {0}'.format(self.table_name))
 
     def open(self):
         self.conn = connect(self.db_name)
@@ -63,12 +63,12 @@
         pass
 
     def __iter__(self):
-        for row in self.conn.execute("select key from %s" % self.table_name):
+        for row in self.conn.execute("select key from {0}".format(self.table_name)):
             yield row['key']
 
     def __delitem__(self, key):
         with self.conn:
-            self.conn.execute('delete from %s where key=?' % self.table_name, (key, ))
+            self.conn.execute('delete from {0} where key=?'.format(self.table_name), (key, ))
 
     def _compress(self, value):
         if self.compression_level:
@@ -89,7 +89,7 @@
 
 class BytesStore(_Store, BytesMutableStoreBase):
     def __getitem__(self, key):
-        rows = list(self.conn.execute("select value from %s where key=?" % self.table_name, (key, )))
+        rows = list(self.conn.execute("select value from {0} where key=?".format(self.table_name), (key, )))
         if not rows:
             raise KeyError(key)
         value = str(rows[0]['value'])
@@ -98,12 +98,12 @@
     def __setitem__(self, key, value):
         value = self._compress(value)
         with self.conn:
-            self.conn.execute('insert into %s values (?, ?)' % self.table_name, (key, buffer(value)))
+            self.conn.execute('insert into {0} values (?, ?)'.format(self.table_name), (key, buffer(value)))
 
 
 class FileStore(_Store, FileMutableStoreBase):
     def __getitem__(self, key):
-        rows = list(self.conn.execute("select value from %s where key=?" % self.table_name, (key, )))
+        rows = list(self.conn.execute("select value from {0} where key=?".format(self.table_name), (key, )))
         if not rows:
             raise KeyError(key)
         value = str(rows[0]['value'])
@@ -113,5 +113,5 @@
         value = stream.read()
         value = self._compress(value)
         with self.conn:
-            self.conn.execute('insert into %s values (?, ?)' % self.table_name, (key, buffer(value)))
+            self.conn.execute('insert into {0} values (?, ?)'.format(self.table_name), (key, buffer(value)))
 
--- a/MoinMoin/themes/__init__.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/themes/__init__.py	Sun Oct 16 02:26:35 2011 +0200
@@ -36,7 +36,7 @@
     try:
         return get_theme(theme_name)
     except KeyError:
-        logging.warning("theme %s was not found; using default of %s instead." % (theme_name, app.cfg.theme_default))
+        logging.warning("Theme {0} was not found; using default of {1} instead.".format(theme_name, app.cfg.theme_default))
         theme_name = app.cfg.theme_default
         return get_theme(theme_name)
 
@@ -127,7 +127,7 @@
             aliasname = name
 
         wikiname, itemname = getInterwikiHome(name)
-        title = "%s @ %s" % (aliasname, wikiname)
+        title = "{0} @ {1}".format(aliasname, wikiname)
         # link to (interwiki) user homepage
         if is_local_wiki(wikiname):
             exists = self.storage.has_item(itemname)
@@ -229,10 +229,10 @@
                                 pass # ignore invalid lines
                         f.close()
                         app.cache.set(cid, sisteritems)
-                        logging.info("Site: %s Status: Updated. Pages: %d" % (sistername, len(sisteritems)))
+                        logging.info("Site: {0} Status: Updated. Pages: {1}".format(sistername, len(sisteritems)))
                     except IOError as err:
                         (title, code, msg, headers) = err.args # code e.g. 304
-                        logging.warning("Site: %s Status: Not updated." % sistername)
+                        logging.warning("Site: {0} Status: Not updated.".format(sistername))
                         logging.exception("exception was:")
                 if current in sisteritems:
                     url = sisteritems[current]
@@ -283,11 +283,11 @@
         # only tell ip / hostname if show_hosts is True
         if hostname:
             text = hostname[:15]  # 15 = len(ipaddr)
-            name = title = '%s[%s]' % (hostname, addr)
+            name = title = '{0}[{1}]'.format(hostname, addr)
             css = 'editor host'
         else:
             name = text = addr
-            title = '[%s]' % (addr, )
+            title = '[{0}]'.format(addr)
             css = 'editor ip'
 
     userid = meta.get(USERID)
@@ -300,7 +300,7 @@
             aliasname = name
         if title:
             # we already have some address info
-            title = "%s @ %s" % (aliasname, title)
+            title = "{0} @ {1}".format(aliasname, title)
         else:
             title = aliasname
         if u.mailto_author and u.email:
@@ -341,7 +341,7 @@
         # If it's not enough, replace the middle with '...'
         if len(name) > length:
             half, left = divmod(length - 3, 2)
-            name = u'%s...%s' % (name[:half + left], name[-half:])
+            name = u'{0}...{1}'.format(name[:half + left], name[-half:])
     return name
 
 
@@ -363,7 +363,7 @@
     if not cls:
         # just use the major part of mimetype
         cls = contenttype.split('/', 1)[0]
-    return 'moin-mime-%s' % cls
+    return 'moin-mime-{0}'.format(cls)
 
 
 def utctimestamp(dt):
--- a/MoinMoin/user.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/user.py	Sun Oct 16 02:26:35 2011 +0200
@@ -244,9 +244,9 @@
             self.may = Default(self)
 
     def __repr__(self):
-        return "<%s.%s at 0x%x name:%r itemid:%r valid:%r>" % (
-            self.__class__.__module__, self.__class__.__name__,
-            id(self), self.name, self.itemid, self.valid)
+        return "<{0}.{1} at {2:#x} name:{3!r} itemid:{4!r} valid:{5!r}>".format(
+            self.__class__.__module__, self.__class__.__name__, id(self),
+            self.name, self.itemid, self.valid)
 
     @property
     def language(self):
@@ -469,7 +469,7 @@
                 return True
             # Try regular expression search, skipping bad patterns
             try:
-                pattern = re.compile(r'^%s$' % pattern, re.M)
+                pattern = re.compile(r'^{0}$'.format(pattern), re.M)
             except re.error:
                 continue
             if pattern.search(text):
--- a/MoinMoin/util/_tests/test_iri.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/_tests/test_iri.py	Sun Oct 16 02:26:35 2011 +0200
@@ -297,14 +297,14 @@
     assert u.fragment.fullquoted == fragment
     assert u.fragment.quoted == u'fragment_ä%25?#'
     assert u.fragment.urlquoted == u'fragment_%C3%A4%25?%23'
-    assert unicode(u) == u'wiki://%s%s?%s#%s' % (authority, path, query, fragment)
+    assert unicode(u) == u'wiki://{0}{1}?{2}#{3}'.format(authority, path, query, fragment)
 
 def test_Iri_quote_2():
     authority = u'authority_ä%25%3F%23'
     path = u'/path_ä%25%3F%23'
     query = u'query_ä%25?%23'
     fragment = u'fragment_ä%25?%23'
-    i = u'wiki://%s%s?%s#%s' % (authority, path, query, fragment)
+    i = u'wiki://{0}{1}?{2}#{3}'.format(authority, path, query, fragment)
     u = Iri(i)
     assert unicode(u) == i
 
--- a/MoinMoin/util/_tests/test_pysupport.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/_tests/test_pysupport.py	Sun Oct 16 02:26:35 2011 +0200
@@ -54,7 +54,7 @@
     def checkPackage(self, path):
         for item in (path, os.path.join(path, '__init__.py')):
             if not os.path.exists(item):
-                pytest.skip("Missing or wrong permissions: %s" % item)
+                pytest.skip("Missing or wrong permissions: {0}".format(item))
 
     def pluginExists(self):
         return (os.path.exists(self.pluginFilePath('.py')) or
@@ -71,7 +71,7 @@
     def testNonExisting(self):
         """ pysupport: import nonexistent wiki plugin fail """
         if self.pluginExists():
-            pytest.skip('plugin exists: %s' % self.plugin)
+            pytest.skip('plugin exists: {0}'.format(self.plugin))
         pytest.raises(plugins.PluginMissingError,
                        plugins.importWikiPlugin,
                            app.cfg, 'parser',
@@ -107,7 +107,7 @@
         """ Create test plugin, skiping if plugin exists """
         if self.pluginExists():
             self.shouldDeleteTestPlugin = False
-            pytest.skip("Won't overwrite existing plugin: %s" % self.plugin)
+            pytest.skip("Won't overwrite existing plugin: {0}".format(self.plugin))
         self.key = crypto.random_string(32, 'abcdefg')
         data = '''
 # If you find this file in your wiki plugin directory, you can safely
@@ -115,12 +115,12 @@
 import sys, os
 
 class Parser:
-    key = '%s'
-''' % self.key
+    key = '{0}'
+'''.format(self.key)
         try:
             file(self.pluginFilePath('.py'), 'w').write(data)
         except Exception as err:
-            pytest.skip("Can't create test plugin: %s" % str(err))
+            pytest.skip("Can't create test plugin: {0!s}".format(err))
 
     def deleteTestPlugin(self):
         """ Delete plugin files ignoring missing files errors """
--- a/MoinMoin/util/clock.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/clock.py	Sun Oct 16 02:26:35 2011 +0200
@@ -37,11 +37,11 @@
     def stop(self, timer):
         if timer in self.timers:
             value = time.time() - self.timers[timer].pop()
-            logging.info('timer %s(%d): %.2fms' % (timer, len(self.timers[timer]), value*1000))
+            logging.info('timer {0}({1}): {2:.2f}ms'.format(timer, len(self.timers[timer]), value*1000))
             if not self.timers[timer]:
                 del self.timers[timer]
             return value
 
     def __del__(self):
         if self.timers:
-            logging.warning('These timers have not been stopped: %s' % ', '.join(self.timers.keys()))
+            logging.warning('These timers have not been stopped: {0}'.format(', '.join(self.timers.keys())))
--- a/MoinMoin/util/crypto.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/crypto.py	Sun Oct 16 02:26:35 2011 +0200
@@ -149,11 +149,11 @@
                 salt = d[:2]
                 enc = crypt.crypt(pw_utf8, salt.encode('ascii'))
             else:
-                raise ValueError("missing password hash method %s handler" % method)
+                raise ValueError("missing password hash method {0} handler".format(method))
             return pw_hash == method + enc
     else:
         idx = pw_hash.index('}') + 1
-        raise ValueError("unsupported password hash method %r" % pw_hash[:idx])
+        raise ValueError("unsupported password hash method {0!r}".format(pw_hash[:idx]))
 
 
 # password recovery token
--- a/MoinMoin/util/diff_html.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/diff_html.py	Sun Oct 16 02:26:35 2011 +0200
@@ -72,12 +72,12 @@
         if charobj.ratio() < 0.5:
             # Insufficient similarity.
             if leftpane:
-                leftresult = """<span>%s</span>""" % indent(escape(leftpane))
+                leftresult = """<span>{0}</span>""".format(indent(escape(leftpane)))
             else:
                 leftresult = ''
 
             if rightpane:
-                rightresult = """<span>%s</span>""" % indent(escape(rightpane))
+                rightresult = """<span>{0}</span>""".format(indent(escape(rightpane)))
             else:
                 rightresult = ''
         else:
@@ -88,11 +88,11 @@
             rightresult = ''
             for thismatch in charmatch:
                 if thismatch[0] - charlast[0] != 0:
-                    leftresult += """<span>%s</span>""" % indent(
-                        escape(leftpane[charlast[0]:thismatch[0]]))
+                    leftresult += """<span>{0}</span>""".format(indent(
+                        escape(leftpane[charlast[0]:thismatch[0]])))
                 if thismatch[1] - charlast[1] != 0:
-                    rightresult += """<span>%s</span>""" % indent(
-                        escape(rightpane[charlast[1]:thismatch[1]]))
+                    rightresult += """<span>{0}</span>""".format(indent(
+                        escape(rightpane[charlast[1]:thismatch[1]])))
                 leftresult += escape(leftpane[thismatch[0]:thismatch[0] + thismatch[2]])
                 rightresult += escape(rightpane[thismatch[1]:thismatch[1] + thismatch[2]])
                 charlast = (thismatch[0] + thismatch[2], thismatch[1] + thismatch[2])
--- a/MoinMoin/util/diff_text.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/diff_text.py	Sun Oct 16 02:26:35 2011 +0200
@@ -59,8 +59,7 @@
                 count = 0
             elif count > 6:
                 # remove lines and insert new hunk indicator
-                lines[i-count+3:i-3] = ['@@ -%i, +%i @@\n' %
-                                        (lcount_old, lcount_new)]
+                lines[i-count+3:i-3] = ['@@ -{0:d}, +{1:d} @@\n'.format(lcount_old, lcount_new)]
                 i = i - count + 8
                 count = 0
             else:
--- a/MoinMoin/util/filesys.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/filesys.py	Sun Oct 16 02:26:35 2011 +0200
@@ -105,7 +105,7 @@
                     if retry > max_retries:
                         raise
                     if err.errno == errno.EACCES:
-                        logging.warning('%s(%r, %r) -> access denied. retrying...' % (fn.__name__, args, kwargs))
+                        logging.warning('{0}({1!r}, {2!r}) -> access denied. retrying...'.format(fn.__name__, args, kwargs))
                         time.sleep(0.01)
                         continue
                     raise
--- a/MoinMoin/util/interwiki.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/interwiki.py	Sun Oct 16 02:26:35 2011 +0200
@@ -65,7 +65,7 @@
         try:
             wiki_base_url = app.cfg.interwiki_map[wiki_name]
         except KeyError, err:
-            logging.warning("no interwiki_map entry for %r" % wiki_name)
+            logging.warning("no interwiki_map entry for {0!r}".format(wiki_name))
             url = '' # can we find something useful?
         else:
             if (rev is None or rev == CURRENT) and endpoint == 'frontend.show_item':
@@ -132,7 +132,7 @@
     :rtype: unicode
     :returns: wiki_name:item_name
     """
-    return "%s:%s" % (app.cfg.interwikiname, item_name)
+    return "{0}:{1}".format(app.cfg.interwikiname, item_name)
 
 
 def getInterwikiHome(username):
--- a/MoinMoin/util/iri.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/iri.py	Sun Oct 16 02:26:35 2011 +0200
@@ -162,7 +162,7 @@
         return not ret
 
     def __repr__(self):
-        return '%s(scheme=%r, authority=%r, path=%r, query=%r, fragment=%r)' % (
+        return '{0}(scheme={1!r}, authority={2!r}, path={3!r}, query={4!r}, fragment={5!r})'.format(
                 self.__class__.__name__,
                 self.scheme,
                 self._authority,
@@ -459,7 +459,7 @@
         return False
 
     def __repr__(self):
-        return '%s(userinfo=%r, host=%r, port=%r)' % (
+        return '{0}(userinfo={1!r}, host={2!r}, port={3!r})'.format(
                 self.__class__.__name__,
                 self._userinfo,
                 self._host,
@@ -622,7 +622,7 @@
         return u'/'.join(self._list)
 
     def __repr__(self):
-        return '%s(%r)' % (
+        return '{0}({1!r})'.format(
                 self.__class__.__name__,
                 unicode(self),
                 )
--- a/MoinMoin/util/lock.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/lock.py	Sun Oct 16 02:26:35 2011 +0200
@@ -112,7 +112,7 @@
             try:
                 filesys.mkdir(self.lockDir)
                 self._locked = True
-                logging.debug('acquired exclusive lock: %s' % (self.lockDir, ))
+                logging.debug('acquired exclusive lock: {0}'.format(self.lockDir, ))
                 return True
             except OSError as err:
                 if err.errno != errno.EEXIST:
@@ -120,16 +120,16 @@
                 if self.expire():
                     continue # Try immediately to acquire
                 timer.sleep()
-        logging.debug('failed to acquire exclusive lock: %s' % (self.lockDir, ))
+        logging.debug('failed to acquire exclusive lock: {0}'.format(self.lockDir, ))
         return False
 
     def release(self):
         """ Release the lock """
         if not self._locked:
-            raise RuntimeError('lock already released: %s' % self.lockDir)
+            raise RuntimeError('lock already released: {0}'.format(self.lockDir))
         self._removeLockDir()
         self._locked = False
-        logging.debug('released lock: %s' % self.lockDir)
+        logging.debug('released lock: {0}'.format(self.lockDir))
 
     def isLocked(self):
         return self._locked
@@ -159,7 +159,7 @@
         """ Return True if the lock is expired or missing; False otherwise. """
         if self.isExpired():
             self._removeLockDir()
-            logging.debug("expired lock: %s" % self.lockDir)
+            logging.debug("expired lock: {0}".format(self.lockDir))
             return True
         return False
 
@@ -169,7 +169,7 @@
         """ Make sure directory exists """
         try:
             filesys.mkdir(self.dir)
-            logging.debug('created directory: %s' % self.dir)
+            logging.debug('created directory: {0}'.format(self.dir))
         except OSError as err:
             if err.errno != errno.EEXIST:
                 raise
@@ -178,7 +178,7 @@
         """ Remove lockDir ignoring 'No such file or directory' errors """
         try:
             filesys.rmdir(self.lockDir)
-            logging.debug('removed directory: %s' % self.dir)
+            logging.debug('removed directory: {0}'.format(self.dir))
         except OSError as err:
             if err.errno != errno.ENOENT:
                 raise
@@ -237,7 +237,7 @@
                     timer.sleep()
             finally:
                 if result:
-                    logging.debug('acquired write lock: %s' % self.lockDir)
+                    logging.debug('acquired write lock: {0}'.format(self.lockDir))
                     return True
                 else:
                     self.release()
@@ -298,7 +298,7 @@
             try:
                 self.lockDir = tempfile.mkdtemp('', self.fileName, self.dir)
                 self._locked = True
-                logging.debug('acquired read lock: %s' % self.lockDir)
+                logging.debug('acquired read lock: {0}'.format(self.lockDir))
                 return True
             finally:
                 self.writeLock.release()
--- a/MoinMoin/util/mime.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/mime.py	Sun Oct 16 02:26:35 2011 +0200
@@ -64,7 +64,7 @@
         return not ret
 
     def __repr__(self):
-        return '<%s object: type: %r; subtype: %r; parameters: %r>' % (
+        return '<{0} object: type: {1!r}; subtype: {2!r}; parameters: {3!r}>'.format(
                 self.__class__.__name__,
                 self.type,
                 self.subtype,
@@ -72,14 +72,14 @@
                 )
 
     def __unicode__(self):
-        ret = [u'%s/%s' % (self.type or '*', self.subtype or '*')]
+        ret = [u'{0}/{1}'.format(self.type or '*', self.subtype or '*')]
 
         parameters = sorted(self.parameters.items())
         for key, value in parameters:
             if self.__token_check(value):
-                ret.append(u'%s=%s' % (key, value))
+                ret.append(u'{0}={1}'.format(key, value))
             else:
-                ret.append(u'%s="%s"' % (key, value))
+                ret.append(u'{0}="{1}"'.format(key, value))
 
         return u';'.join(ret)
 
--- a/MoinMoin/util/mimetype.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/mimetype.py	Sun Oct 16 02:26:35 2011 +0200
@@ -133,7 +133,7 @@
             try:
                 mimetype = mapping[format]
             except KeyError:
-                mimetype = 'text', 'x-%s' % format
+                mimetype = 'text', 'x-{0}'.format(format)
         return mimetype
 
     def sanitize(self):
@@ -161,14 +161,14 @@
             charset = charset or self.charset
             if charset:
                 params['charset'] = charset
-        mimestr = "%s/%s" % (major, minor)
-        params = ['%s="%s"' % (key.lower(), value) for key, value in params.items()]
+        mimestr = "{0}/{1}".format(major, minor)
+        params = ['{0}="{1}"'.format(key.lower(), value) for key, value in params.items()]
         params.insert(0, mimestr)
         return "; ".join(params)
 
     def mime_type(self):
         """ return a string major/minor only, no params """
-        return "%s/%s" % (self.major, self.minor)
+        return "{0}/{1}".format(self.major, self.minor)
 
     def as_attachment(self, cfg):
         # for dangerous files (like .html), when we are in danger of cross-site-scripting attacks,
--- a/MoinMoin/util/monkeypatch.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/monkeypatch.py	Sun Oct 16 02:26:35 2011 +0200
@@ -19,8 +19,8 @@
 
 class BaseRequestHandler(werkzeug.serving.BaseRequestHandler):
     def log(self, type, message, *args):
-        _log(type, "%s %s\n" % (self.address_string(),
-                                message % args))
+        _log(type, "{0} {1}\n".format(self.address_string(),
+                                message.format(args)))
 
 werkzeug.serving.BaseRequestHandler = BaseRequestHandler
 werkzeug.serving.WSGIRequestHandler = BaseRequestHandler
--- a/MoinMoin/util/paramparser.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/paramparser.py	Sun Oct 16 02:26:35 2011 +0200
@@ -15,12 +15,12 @@
 class BracketUnexpectedCloseError(BracketError):
     def __init__(self, bracket):
         self.bracket = bracket
-        BracketError.__init__(self, "Unexpected closing bracket %s" % bracket)
+        BracketError.__init__(self, "Unexpected closing bracket {0}".format(bracket))
 
 class BracketMissingCloseError(BracketError):
     def __init__(self, bracket):
         self.bracket = bracket
-        BracketError.__init__(self, "Missing closing bracket %s" % bracket)
+        BracketError.__init__(self, "Missing closing bracket {0}".format(bracket))
 
 
 class ParserPrefix(object):
@@ -36,7 +36,7 @@
         return isinstance(other, ParserPrefix) and other.prefix == self.prefix
 
     def __repr__(self):
-        return '<ParserPrefix(%s)>' % self.prefix.encode('utf-8')
+        return '<ParserPrefix({0})>'.format(self.prefix.encode('utf-8'))
 
 
 def parse_quoted_separated_ext(args, separator=None, name_value_separator=None,
@@ -532,7 +532,7 @@
                 pass
         units = ', '.join(self._units)
         ## XXX: how can we translate this?
-        raise ValueError("Invalid unit in value %s (allowed units: %s)" % (s, units))
+        raise ValueError("Invalid unit in value {0} (allowed units: {1})".format(s, units))
 
     def get_default(self):
         return self._default
--- a/MoinMoin/util/plugins.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/plugins.py	Sun Oct 16 02:26:35 2011 +0200
@@ -68,7 +68,7 @@
     modname = plugins.get(name, None)
     if modname is None:
         raise PluginMissingError()
-    moduleName = '%s.%s' % (modname, name)
+    moduleName = '{0}.{1}'.format(modname, name)
     return importNameFromPlugin(moduleName, function)
 
 
@@ -79,7 +79,7 @@
     """
     if not name in builtinPlugins(kind):
         raise PluginMissingError()
-    moduleName = 'MoinMoin.%s.%s' % (kind, name)
+    moduleName = 'MoinMoin.{0}.{1}'.format(kind, name)
     return importNameFromPlugin(moduleName, function)
 
 
@@ -142,7 +142,7 @@
                 plugins = pysupport.getPluginModules(packagepath)
                 for p in plugins:
                     if not p in result:
-                        result[p] = '%s.%s' % (modname, kind)
+                        result[p] = '{0}.{1}'.format(modname, kind)
             except AttributeError:
                 pass
         cache[kind] = result
@@ -181,7 +181,7 @@
         except PluginMissingError:
             pass
     else:
-        raise PluginMissingError("Plugin not found! (%r %r %r)" % (type, name, what))
+        raise PluginMissingError("Plugin not found! ({0!r} {1!r} {2!r})".format(type, name, what))
     return plugin
 
 
@@ -203,8 +203,8 @@
         imp.acquire_lock()
         try:
             for pdir in cfg.plugin_dirs:
-                csum = 'p_%s' % hashlib.new('sha1', pdir).hexdigest()
-                modname = '%s.%s' % (cfg.siteid, csum)
+                csum = 'p_{0}'.format(hashlib.new('sha1', pdir).hexdigest())
+                modname = '{0}.{1}'.format(cfg.siteid, csum)
                 # If the module is not loaded, try to load it
                 if not modname in sys.modules:
                     # Find module on disk and try to load - slow!
--- a/MoinMoin/util/profile.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/profile.py	Sun Oct 16 02:26:35 2011 +0200
@@ -57,7 +57,7 @@
         :param requestsPerSample: how many request to run between samples
         :param collect: should call gc.collect() in each sample
         """
-        logname = '%s--%s.log' % (name, time.strftime('%Y-%m-%d--%H-%M'))
+        logname = '{0}--{1}.log'.format(name, time.strftime('%Y-%m-%d--%H-%M'))
         self.logfile = file(logname, 'a')
         self.requestsPerSample = requestsPerSample
         self.collect = collect
@@ -119,7 +119,7 @@
         Uses ps call, maybe we should use procfs on Linux or maybe
         getrusage system call (using the ctypes module).
         """
-        lines = os.popen('/bin/ps -p %s -o rss' % self.pid).readlines()
+        lines = os.popen('/bin/ps -p {0} -o rss'.format(self.pid)).readlines()
         self.data['memory'] = lines[1].strip()
 
     def _log(self):
--- a/MoinMoin/util/pysupport.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/pysupport.py	Sun Oct 16 02:26:35 2011 +0200
@@ -43,7 +43,7 @@
                     except Exception as e:
                         import MoinMoin.log as logging
                         logger = logging.getLogger(package_name)
-                        logger.exception("Failed to import %s package module %s: %s" % (package_name, module, e))
+                        logger.exception("Failed to import {0} package module {1}: {2}".format(package_name, module, e))
                 finally:
                     info[0].close()
 
--- a/MoinMoin/util/registry.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/registry.py	Sun Oct 16 02:26:35 2011 +0200
@@ -34,7 +34,7 @@
             return NotImplemented
 
         def __repr__(self):
-            return '<%s: prio %d [%r]>' % (self.__class__.__name__,
+            return '<{0}: prio {1} [{2!r}]>'.format(self.__class__.__name__,
                     self.priority,
                     self.factory)
 
@@ -42,7 +42,7 @@
         self._entries = []
 
     def __repr__(self):
-        return '<%s: %r>' % (self.__class__.__name__, self._entries)
+        return '<{0}: {1!r}>'.format(self.__class__.__name__, self._entries)
 
     def get(self, *args, **kw):
         """
--- a/MoinMoin/util/send_file.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/send_file.py	Sun Oct 16 02:26:35 2011 +0200
@@ -36,7 +36,7 @@
     :param coding: the coding (charset) to use. it is a good idea to use 'UTF-8'.
     :param lang: the language to use. defaults to empty string (no language given).
     """
-    return "%s'%s'%s" % (coding, lang, url_quote(value, charset=coding))
+    return "{0}'{1}'{2}".format(coding, lang, url_quote(value, charset=coding))
 
 
 def send_file(filename=None, file=None,
@@ -121,7 +121,7 @@
         # Note: we only give filename* param, not filename param, hoping that a user agent that
         # does not support filename* then falls back into using the last URL fragment (and decodes
         # that correctly). See there for details: http://greenbytes.de/tech/tc2231/
-        headers.add('Content-Disposition', 'attachment; filename*=%s'% encode_rfc2231(attachment_filename))
+        headers.add('Content-Disposition', 'attachment; filename*={0}'.format(encode_rfc2231(attachment_filename)))
 
     if current_app.use_x_sendfile and filename:
         if file:
@@ -154,7 +154,7 @@
 
     if add_etags:
         if etag is None and filename:
-            etag = 'flask-%s-%s-%s' % (
+            etag = 'flask-{0}-{1}-{2}'.format(
                 mtime or os.path.getmtime(filename),
                 os.path.getsize(filename),
                 adler32(filename) & 0xffffffff
--- a/MoinMoin/util/thread_monitor.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/thread_monitor.py	Sun Oct 16 02:26:35 2011 +0200
@@ -39,7 +39,7 @@
         cur_frames = sys._current_frames()
         for i in cur_frames:
             s = StringIO()
-            print >>s, "\nDumping thread (id %s):" % (i, )
+            print >>s, "\nDumping thread (id {0}):".format(i, )
             traceback.print_stack(cur_frames[i], file=s)
             dumpfile.write(s.getvalue())
 
--- a/MoinMoin/util/tree.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/tree.py	Sun Oct 16 02:26:35 2011 +0200
@@ -50,7 +50,7 @@
         return Name(key, self)
 
     def __repr__(self):
-        return '<%s(%r)>' % (self.__class__.__name__, self)
+        return '<{0}({1!r})>'.format(self.__class__.__name__, self)
 
     @property
     def namespace(self):
--- a/MoinMoin/util/version.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/util/version.py	Sun Oct 16 02:26:35 2011 +0200
@@ -43,7 +43,7 @@
     def parse_version(cls, version):
         match = cls.VERSION_RE.match(version)
         if match is None:
-            raise ValueError("Unexpected version string format: %r" % version)
+            raise ValueError("Unexpected version string format: {0!r}".format(version))
         v = match.groupdict()
         return int(v['major']), int(v['minor']), int(v['release']), str(v['additional'] or 'd0')
 
@@ -60,7 +60,7 @@
     additional = property(lambda self: self[3] if self[3] != 'd0' else '')
 
     def __str__(self):
-        version_str = "%d.%d.%d" % (self.major, self.minor, self.release)
+        version_str = "{0}.{1}.{2}".format(self.major, self.minor, self.release)
         if self.additional != 'd0':
             version_str += self.additional
         return version_str
--- a/MoinMoin/wikiutil.py	Sat Oct 15 23:46:30 2011 +0200
+++ b/MoinMoin/wikiutil.py	Sun Oct 16 02:26:35 2011 +0200
@@ -272,7 +272,7 @@
     quoted = werkzeug.url_quote_plus(text, charset='utf-7', safe=':')
     res = quoted.replace('%', '.').replace('+', '_')
     if not res[:1].isalpha():
-        return 'A%s' % res
+        return 'A{0}'.format(res)
     return res
 
 def split_anchor(pagename):