U-Boot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Tom Rini <trini@konsulko.com>
To: u-boot@lists.denx.de
Subject: [U-Boot] [PATCH] buildman: Translate more strings to latin-1
Date: Fri, 2 Jun 2017 09:21:51 -0400	[thread overview]
Message-ID: <20170602132151.GF10782@bill-the-cat> (raw)
In-Reply-To: <3d3fd74d-67b0-f660-1bec-96017b921b1a@gmail.com>

On Fri, Jun 02, 2017 at 11:18:27AM +0200, Daniel Schwierzeck wrote:
> 
> 
> Am 01.06.2017 um 15:21 schrieb Simon Glass:
> > Hi Daniel,
> > 
> > On 31 May 2017 at 07:40, Daniel Schwierzeck
> > <daniel.schwierzeck@gmail.com> wrote:
> >> This is a follow-up patch for commit fbeb33752999e7317113199ef89873d6b6916814.
> >>
> >> This fixes following exception:
> >>
> >> Exception in thread Thread-7:
> >> Traceback (most recent call last):
> >>   File "/usr/lib/python2.7/threading.py", line 801, in __bootstrap_inner
> >>     self.run()
> >>   File "/u-boot/tools/buildman/builderthread.py", line 475, in run
> >>     self.RunJob(job)
> >>   File "/u-boot/tools/buildman/builderthread.py", line 456, in RunJob
> >>     self._WriteResult(result, job.keep_outputs)
> >>   File "/u-boot/tools/buildman/builderthread.py", line 333, in _WriteResult
> >>     print >>fd, dump_result.stdout,
> >> UnicodeEncodeError: 'ascii' codec can't encode characters in position 75-76: ordinal not in range(128)
> >>
> >> Signed-off-by: Daniel Schwierzeck <daniel.schwierzeck@gmail.com>
> >>
> >> ---
> >>
> >>  tools/buildman/builderthread.py | 2 +-
> >>  1 file changed, 1 insertion(+), 1 deletion(-)
> >>
> >> diff --git a/tools/buildman/builderthread.py b/tools/buildman/builderthread.py
> >> index acaf5007f5..0a460878f3 100644
> >> --- a/tools/buildman/builderthread.py
> >> +++ b/tools/buildman/builderthread.py
> >> @@ -330,7 +330,7 @@ class BuilderThread(threading.Thread):
> >>                      objdump = self.builder.GetObjdumpFile(result.commit_upto,
> >>                                      result.brd.target, fname)
> >>                      with open(objdump, 'w') as fd:
> >> -                        print >>fd, dump_result.stdout,
> >> +                        print >>fd, dump_result.stdout.encode('latin-1', 'ignore'),
> > 
> > I am worried that this will produce gibberish in the output. Do you
> > know what specific characters are causing problems? Can we encode to
> > utf-8? BTW I recently sent a patman series to try to resolve unicode
> > issues in patman.
> > 
> 
> objdump uses localized output. If I use LC_ALL=C, the exception doesn't
> occur. My system's default language is German. Thus the offending
> character is the German 'ö':
> 
> ...
> Sektionen:
> Idx Name          Größe     VMA       LMA       Datei-Off Ausr.
>   0 .text         00032a94  9f000000  9f000000  000000c0  2**4
>                   CONTENTS, ALLOC, LOAD, CODE
>   1 .rodata       00008e50  9f032aa0  9f032aa0  00032b60  2**4
>                   CONTENTS, ALLOC, LOAD, READONLY, DATA
> ...
> 
> Actually I'd chosen UTF-8 too, but I followed Tom's patch which used
> latin-1 ;)
> 
> So we should always encode the output of tools such as binutils to
> UTF-8, shouldn't we? I can send an updated patch.

I'd be fine with UTF-8 everywhere too, I just borrowed an existing
example that was latin-1 :)

-- 
Tom
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 819 bytes
Desc: Digital signature
URL: <http://lists.denx.de/pipermail/u-boot/attachments/20170602/b79e210e/attachment.sig>

  reply	other threads:[~2017-06-02 13:21 UTC|newest]

Thread overview: 16+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2017-05-31 13:40 [U-Boot] [PATCH] buildman: Translate more strings to latin-1 Daniel Schwierzeck
2017-06-01 13:21 ` Simon Glass
2017-06-02  9:18   ` Daniel Schwierzeck
2017-06-02 13:21     ` Tom Rini [this message]
2017-06-07 11:55       ` Simon Glass
2017-06-07 12:07         ` Daniel Schwierzeck
2017-06-07 12:19 ` [U-Boot] [PATCH v2] buildman: Translate binutils output to UTF-8 Daniel Schwierzeck
2017-06-07 15:52   ` Simon Glass
2017-06-07 16:03     ` Daniel Schwierzeck
2017-06-09 12:27       ` Simon Glass
2017-06-09 12:43         ` Daniel Schwierzeck
2017-06-08  1:07   ` [U-Boot] [PATCH 0/2] Fix unicode handling in buildman Daniel Schwierzeck
2017-06-08  1:07     ` [U-Boot] [PATCH 1/2] buildman: disable localized and unicode output of all build tools Daniel Schwierzeck
2017-06-09  0:01       ` sjg at google.com
2017-06-08  1:07     ` [U-Boot] [PATCH 2/2] buildman: properly translate strings for log and err files to ASCII Daniel Schwierzeck
2017-06-09  0:01       ` sjg at google.com

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=20170602132151.GF10782@bill-the-cat \
    --to=trini@konsulko.com \
    --cc=u-boot@lists.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