From: Florian Weimer <fweimer@redhat.com>
To: "H.J. Lu" <hjl.tools@gmail.com>
Cc: libc-alpha@sourceware.org
Subject: Re: [PATCH] test_printers_common.py: Remove invalid escape sequence
Date: Mon, 12 Feb 2024 15:03:35 +0100 [thread overview]
Message-ID: <87bk8lbwzs.fsf@oldenburg3.str.redhat.com> (raw)
In-Reply-To: <CAMe9rOpKjqJ-K+ZKiE0+0fD3148yvmD2oOEp=1cZONP0p=UwNQ@mail.gmail.com> (H. J. Lu's message of "Mon, 12 Feb 2024 05:55:47 -0800")
* H. J. Lu:
> On Mon, Feb 12, 2024 at 5:47 AM Florian Weimer <fweimer@redhat.com> wrote:
>>
>> * H. J. Lu:
>>
>> > Remove '\(' and '\)' from test_printers_common.py which aren't valid
>> > Python escape sequences. This fixes the test warning:
>> >
>> > .../scripts/test_printers_common.py:101: SyntaxWarning: invalid escape sequence '\('
>> > ---
>> > scripts/test_printers_common.py | 2 +-
>> > 1 file changed, 1 insertion(+), 1 deletion(-)
>> >
>> > diff --git a/scripts/test_printers_common.py b/scripts/test_printers_common.py
>> > index bf700966ac..7085a2fbc2 100644
>> > --- a/scripts/test_printers_common.py
>> > +++ b/scripts/test_printers_common.py
>> > @@ -98,7 +98,7 @@ try:
>> > # If everything's ok, spawn the gdb process we'll use for testing.
>> > gdb = pexpect.spawn(gdb_invocation, echo=False, timeout=timeout,
>> > encoding=encoding)
>> > - gdb_prompt = u'\(gdb\)'
>> > + gdb_prompt = u'(gdb)'
>> > gdb.expect(gdb_prompt)
>> >
>> > except pexpect.ExceptionPexpect as exception:
>>
>> This changes the string, you should use:
>>
>> + gdb_prompt = u'\\(gdb\\)'
>>
>
> This change, \\( and \\), causes:
>
> FAIL: nptl/test-cond-printers
> FAIL: nptl/test-condattr-printers
> FAIL: nptl/test-mutex-printers
> FAIL: nptl/test-mutexattr-printers
> FAIL: nptl/test-rwlock-printers
> FAIL: nptl/test-rwlockattr-printers
>
> My change doesn't have any regression.
I don't understand that. Python 2.7.5 and 3.11.7 treat u'\(gdb\)' as
u'\\(gdb\\)'.
Thanks,
Florian
next prev parent reply other threads:[~2024-02-12 14:03 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-02-12 13:35 H.J. Lu
2024-02-12 13:44 ` Andreas Schwab
2024-02-12 13:47 ` Florian Weimer
2024-02-12 13:55 ` H.J. Lu
2024-02-12 14:03 ` Florian Weimer [this message]
2024-02-12 14:07 ` H.J. Lu
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=87bk8lbwzs.fsf@oldenburg3.str.redhat.com \
--to=fweimer@redhat.com \
--cc=hjl.tools@gmail.com \
--cc=libc-alpha@sourceware.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).