aboutsummaryrefslogtreecommitdiffstats
path: root/repoman/lib/repoman/modules/linechecks/controller.py
diff options
context:
space:
mode:
authorZac Medico <zmedico@gentoo.org>2019-11-07 21:42:16 -0800
committerZac Medico <zmedico@gentoo.org>2019-11-07 21:43:26 -0800
commitd8879e74458935919a4303f4fd1d2d24eb92e094 (patch)
tree9af5ee2bbfb1ec3f8326c260335b7a7308321a8d /repoman/lib/repoman/modules/linechecks/controller.py
parentrepoman: fix unsafe string interpolation (bug 699508) (diff)
downloadgentoo-portage-d8879e74458935919a4303f4fd1d2d24eb92e094.tar.xz
gentoo-portage-d8879e74458935919a4303f4fd1d2d24eb92e094.zip
Revert "repoman: fix unsafe string interpolation (bug 699508)"
This reverts commit d156784fd7557e8f5ce8a6de5cd3a6a38a78e436. The 'on line: %d' string fails to match some messages. Reported-by: Arfrever Frehtes Taifersar Arahesis <Arfrever@Apache.Org> Bug: https://bugs.gentoo.org/699508 Signed-off-by: Zac Medico <zmedico@gentoo.org>
Diffstat (limited to 'repoman/lib/repoman/modules/linechecks/controller.py')
-rw-r--r--repoman/lib/repoman/modules/linechecks/controller.py5
1 files changed, 1 insertions, 4 deletions
diff --git a/repoman/lib/repoman/modules/linechecks/controller.py b/repoman/lib/repoman/modules/linechecks/controller.py
index b468e348d..7082a5d02 100644
--- a/repoman/lib/repoman/modules/linechecks/controller.py
+++ b/repoman/lib/repoman/modules/linechecks/controller.py
@@ -1,6 +1,4 @@
-from __future__ import unicode_literals
-
import logging
import operator
import os
@@ -138,8 +136,7 @@ class LineCheckController(object):
if not ignore or not ignore.match(line):
e = lc.check(num, line)
if e:
- # String interpolation on the variable e is unsafe because it can contain % characters.
- yield lc.repoman_check_name, e.replace('on line: %d', 'on line: %d' % strnum + 1)
+ yield lc.repoman_check_name, e % (num + 1)
for lc in checks:
i = lc.end()