On Tue, Sep 24, 2013 at 5:26 PM, Michele Tartara <[email protected]>wrote:
> Mark the string representing a regular expression as a raw string, so that > the > entire escaping is performed by the regexp parser. > > Actually, the string is not just a regular expression, but a command containing a regular expression. So, I'll use the following commit message instead: ------ Fix an improperly escaped string Mark a string representing a "sed" command including a regular expression as a raw string, so that the entire escaping is performed by "sed" itself. -------- Signed-off-by: Michele Tartara <[email protected]> > --- > qa/qa_utils.py | 4 ++-- > 1 file changed, 2 insertions(+), 2 deletions(-) > > diff --git a/qa/qa_utils.py b/qa/qa_utils.py > index bcef97f..3bbd85e 100644 > --- a/qa/qa_utils.py > +++ b/qa/qa_utils.py > @@ -625,8 +625,8 @@ def RemoveFromEtcHosts(hostnames): > > sed_data = " ".join(hostnames) > try: > - AssertCommand(("sed -e '/^\(::1\|127\.0\.0\.1\)\s\+%s/d' %s > %s" > - " && mv %s %s") % > + AssertCommand((r"sed -e '/^\(::1\|127\.0\.0\.1\)\s\+%s/d' %s > %s" > + r" && mv %s %s") % > (sed_data, utils.ShellQuote(pathutils.ETC_HOSTS), > quoted_tmp_hosts, quoted_tmp_hosts, > utils.ShellQuote(pathutils.ETC_HOSTS))) > -- > 1.7.10.4 > > Michele -- Google Germany GmbH Dienerstr. 12 80331 München Registergericht und -nummer: Hamburg, HRB 86891 Sitz der Gesellschaft: Hamburg Geschäftsführer: Graham Law, Christine Elizabeth Flores
