changeset 6133:e7cb0147e6fe

Make format strings use named placeholders rather than %s/%r Fixing some issues reported while updating roundup.pot to prep for 2.0.0 beta releases. Still more to do but....
author John Rouillard <rouilj@ieee.org>
date Sat, 04 Apr 2020 11:22:06 -0400
parents 2168da32403d
children 63739dae0f7e
files roundup/backends/rdbms_common.py roundup/scripts/roundup_server.py
diffstat 2 files changed, 5 insertions(+), 3 deletions(-) [+]
line wrap: on
line diff
--- a/roundup/backends/rdbms_common.py	Fri Apr 03 22:38:03 2020 -0400
+++ b/roundup/backends/rdbms_common.py	Sat Apr 04 11:22:06 2020 -0400
@@ -545,8 +545,9 @@
             return 0
 
         if not self.config.RDBMS_ALLOW_ALTER:
-            raise DatabaseError(_('ALTER operation disallowed: %r -> %r.'% (
-                old_spec, new_spec)))
+            raise DatabaseError(_(
+                'ALTER operation disallowed: %(old)r -> %(new)r.'% {
+                    'old': old_spec, 'new': new_spec}))
 
         logger = logging.getLogger('roundup.hyperdb.backend')
         logger.info('update_class %s' % spec.classname)
--- a/roundup/scripts/roundup_server.py	Fri Apr 03 22:38:03 2020 -0400
+++ b/roundup/scripts/roundup_server.py	Sat Apr 04 11:22:06 2020 -0400
@@ -499,7 +499,8 @@
 
 def error():
     exc_type, exc_value = sys.exc_info()[:2]
-    return _('Error: %s: %s' % (exc_type, exc_value))
+    return _('Error: %(type)s: %(value)s' % {'type': exc_type,
+                                             'value': exc_value})
 
 
 def setgid(group):

Roundup Issue Tracker: http://roundup-tracker.org/