From feb39d61ef2de893b93153adc8f1f8140a54fc98 Mon Sep 17 00:00:00 2001 From: Sebastian Schmidt Date: Wed, 2 Jun 2010 17:18:13 +0200 Subject: [PATCH] Fix format string bugs in grep This fixes some format string bugs in grep which cause repo to with "TypeError: not enough arguments for format string" when grepping and the output contains a valid Python format string. Change-Id: Ice8968ea106148d409490e4f71a2833b0cc80816 --- subcmds/grep.py | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/subcmds/grep.py b/subcmds/grep.py index 4f714271..1cb5650b 100644 --- a/subcmds/grep.py +++ b/subcmds/grep.py @@ -204,7 +204,7 @@ contain a line that matches both expressions: else: out.project('--- project %s ---' % project.relpath) out.nl() - out.write(p.stderr) + out.write("%s", p.stderr) out.nl() continue have_match = True @@ -217,17 +217,17 @@ contain a line that matches both expressions: if have_rev and full_name: for line in r: rev, line = line.split(':', 1) - out.write(rev) + out.write("%s", rev) out.write(':') out.project(project.relpath) out.write('/') - out.write(line) + out.write("%s", line) out.nl() elif full_name: for line in r: out.project(project.relpath) out.write('/') - out.write(line) + out.write("%s", line) out.nl() else: for line in r: