Buildroot Archive on lore.kernel.org
 help / color / mirror / Atom feed
From: Peter Korsgaard <peter@korsgaard.com>
To: buildroot@busybox.net
Subject: [Buildroot] [PATCH] support/check-uniq-files: support weird locales and filenames
Date: Sat, 07 Apr 2018 19:50:03 +0200	[thread overview]
Message-ID: <87bmeuewj8.fsf@dell.be.48ers.dk> (raw)
In-Reply-To: <20180331125250.19374-1-yann.morin.1998@free.fr> (Yann E. MORIN's message of "Sat, 31 Mar 2018 14:52:50 +0200")

>>>>> "Yann" == Yann E MORIN <yann.morin.1998@free.fr> writes:

 > Currently, when a filename contains characters not representable in the
 > user's locale, we fail hard, especially when the host python is python3.

 > This is because python2 and python3 handle encoding/decoding strings
 > differently, with python3 presumable doing the right thing, but it
 > breaks on some systems, while python2 presumable does the wrong thing,
 > but it works everywhere. (Just joking, obviously...)

 > Part of the issue being that the csv reader in python2 is broken with
 > UTF8.

 > We fix the issue by ditching the csv reader, and simply read the file in
 > binary mode, manually partitionning the lines on the first comma.

 > Then, we use the binary-encoded (really, un-encoded) package names and
 > filenames as values and keys, respectively.

 > Finally, for each filename of package we need to print, we try to decode
 > them with the default s for the usser settings, but catch any decoding
 > exception and fallback to dumping the raw, binary values. in that case.

 > Thanks a lot to Arnout for the live help doing this patch. :-)

 > Reported-by: Jaap Crezee <jaap@jcz.nl>
 > Signed-off-by: "Yann E. MORIN" <yann.morin.1998@free.fr>
 > Cc: Arnout Vandecappelle <arnout@mind.be>
 > Cc: Jaap Crezee <jaap@jcz.nl>

Committed to 2018.02.x, thanks.

-- 
Bye, Peter Korsgaard

      parent reply	other threads:[~2018-04-07 17:50 UTC|newest]

Thread overview: 5+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2018-03-31 12:52 [Buildroot] [PATCH] support/check-uniq-files: support weird locales and filenames Yann E. MORIN
2018-03-31 13:37 ` Arnout Vandecappelle
2018-04-01 21:25   ` Jaap Crezee
2018-04-01 21:40     ` Yann E. MORIN
2018-04-07 17:50 ` Peter Korsgaard [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=87bmeuewj8.fsf@dell.be.48ers.dk \
    --to=peter@korsgaard.com \
    --cc=buildroot@busybox.net \
    /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