u-boot.lists.denx.de archive mirror
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: Simon Glass <sjg@chromium.org>
Cc: U-Boot Mailing List <u-boot@lists.denx.de>, Wolfgang Denk <wd@denx.de>
Subject: Re: [gitdm PATCH 2/2] logparser.py: Try and be more robust with unicode handling
Date: Tue, 12 Jul 2022 07:05:25 -0400	[thread overview]
Message-ID: <20220712110525.GG1146598@bill-the-cat> (raw)
In-Reply-To: <CAPnjgZ2CSxio7au5eaadooW_sV264D8pT6mc1FYax4YvwA5T_g@mail.gmail.com>

[-- Attachment #1: Type: text/plain, Size: 1653 bytes --]

On Tue, Jul 12, 2022 at 04:58:46AM -0600, Simon Glass wrote:
> On Thu, 7 Jul 2022 at 13:22, Tom Rini <trini@konsulko.com> wrote:
> >
> > Given the sometimes oddly formatted data that can come through when
> > removing code, we need to be as flexible as possible when handling it.
> > Set our encoding to unicode_escape and if we still run in to a problem,
> > it's likely going to be OK to ignore it.
> >
> > Signed-off-by: Tom Rini <trini@konsulko.com>
> > ---
> > I've emailed this to Jonathan Corbet as well as he's the upstream for
> > the project, and this does work for me.  But I'm not a python guru by
> > any means.  But trying to run the stats for v2022.04..v2022.07-rc6 blows
> > up in places otherwise.
> >
> >  logparser.py | 1 +
> >  1 file changed, 1 insertion(+)
> 
> Reviewed-by: Simon Glass <sjg@chromium.org>
> 
> BTW I have found that using binary is helpful in many places, the
> convert to UTF-8 when displaying things.
> 
> 
> >
> > diff --git a/logparser.py b/logparser.py
> > index efbc72f868eb..d5906e97689d 100644
> > --- a/logparser.py
> > +++ b/logparser.py
> > @@ -37,6 +37,7 @@ class LogPatchSplitter:
> >          self.fd = fd
> >          self.buffer = None
> >          self.patch = []
> > +        sys.stdin.reconfigure(encoding='unicode_escape', errors='ignore')
> >
> >      def __iter__(self):
> >          return self

So, I followed up with Jonathan, but hadn't yet for  the list.
unicode_escape works, but then the results don't read right.  It turned
out utf-8 was the right encoding, but the first time I tried testing it
I had some other problem locally.

-- 
Tom

[-- Attachment #2: signature.asc --]
[-- Type: application/pgp-signature, Size: 659 bytes --]

  reply	other threads:[~2022-07-12 11:05 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2022-07-07 19:22 [gitdm PATCH 1/2] Merge branch 'master' into u-boot Tom Rini
2022-07-07 19:22 ` [gitdm PATCH 2/2] logparser.py: Try and be more robust with unicode handling Tom Rini
2022-07-12 10:58   ` Simon Glass
2022-07-12 11:05     ` Tom Rini [this message]
2022-07-12 10:58 ` [gitdm PATCH 1/2] Merge branch 'master' into u-boot Simon Glass

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=20220712110525.GG1146598@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=sjg@chromium.org \
    --cc=u-boot@lists.denx.de \
    --cc=wd@denx.de \
    /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 NNTP newsgroup(s).