public inbox for libc-alpha@sourceware.org
 help / color / mirror / Atom feed
From: "H.J. Lu" <hjl.tools@gmail.com>
To: Joseph Myers <josmyers@redhat.com>
Cc: libc-alpha@sourceware.org
Subject: Re: Fix invalid escape sequence in build-many-glibcs.py
Date: Wed, 10 Jan 2024 07:23:31 -0800	[thread overview]
Message-ID: <CAMe9rOpRPZs1usV1_vrfcHvq5s_9Yz280Qfzjq=RABQb9Ttcww@mail.gmail.com> (raw)
In-Reply-To: <CAMe9rOovM6zgukB9yW1PzwZd-2yfgQd=YJkdQVzWVyVEF_fr_w@mail.gmail.com>

On Wed, Jan 10, 2024 at 7:18 AM H.J. Lu <hjl.tools@gmail.com> wrote:
>
> On Tue, Jan 9, 2024 at 1:24 PM Joseph Myers <josmyers@redhat.com> wrote:
> >
> > Running build-many-glibcs.py with Python 3.12 or later produces a
> > warning:
> >
> > build-many-glibcs.py:173: SyntaxWarning: invalid escape sequence '\.'
> >   m = re.fullmatch('([0-9]+)\.([0-9]+)[.0-9]*', l)
> >
> > Use a raw string instead to avoid that warning.  (Note: I haven't
> > checked whether any other Python scripts included with glibc might
> > have issues with newer Python versions.)
>
> I also got:
>
> /glibc/scripts/build-many-glibcs.py:
> 570: DeprecationWarning: datetime.datetime.utcnow() is deprecated and scheduled
> for removal in a future version. Use timezone-aware objects to represent datetim
> es in UTC: datetime.datetime.now(datetime.UTC).
>   build_time = datetime.datetime.utcnow()
>
> Should it also be fixed?

I saw it has been fixed now.

> > diff --git a/scripts/build-many-glibcs.py b/scripts/build-many-glibcs.py
> > index 7e0b90be89..9a929a6430 100755
> > --- a/scripts/build-many-glibcs.py
> > +++ b/scripts/build-many-glibcs.py
> > @@ -170,7 +170,7 @@ class Context(object):
> >              if l.startswith(starttext):
> >                  l = l[len(starttext):]
> >                  l = l.rstrip('"\n')
> > -                m = re.fullmatch('([0-9]+)\.([0-9]+)[.0-9]*', l)
> > +                m = re.fullmatch(r'([0-9]+)\.([0-9]+)[.0-9]*', l)
> >                  return '%s.%s' % m.group(1, 2)
> >          print('error: could not determine glibc version')
> >          exit(1)
> >
> > --
> > Joseph S. Myers
> > josmyers@redhat.com
> >
>
>
> --
> H.J.



-- 
H.J.

      reply	other threads:[~2024-01-10 15:24 UTC|newest]

Thread overview: 4+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-01-09 21:23 Joseph Myers
2024-01-10 10:39 ` Florian Weimer
2024-01-10 15:18 ` H.J. Lu
2024-01-10 15:23   ` H.J. Lu [this message]

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='CAMe9rOpRPZs1usV1_vrfcHvq5s_9Yz280Qfzjq=RABQb9Ttcww@mail.gmail.com' \
    --to=hjl.tools@gmail.com \
    --cc=josmyers@redhat.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).