From: Brian Norris <briannorris@chromium.org>
To: linux-firmware@kernel.org
Cc: Brian Norris <briannorris@chromium.org>
Subject: [PATCH linux-firmware] check_whence: python3/utf-8 support
Date: Fri, 28 Feb 2020 18:15:05 -0800 [thread overview]
Message-ID: <20200229021505.143663-1-briannorris@chromium.org> (raw)
WHENCE contains non-ASCII characters, so we should specify an encoding.
To get the encoding= arg in python2, we pull open from 'io' directly.
Signed-off-by: Brian Norris <briannorris@chromium.org>
---
check_whence.py | 3 ++-
1 file changed, 2 insertions(+), 1 deletion(-)
diff --git a/check_whence.py b/check_whence.py
index 04f41dfc5f9e..2d31f3839106 100755
--- a/check_whence.py
+++ b/check_whence.py
@@ -1,9 +1,10 @@
#!/usr/bin/python
import os, re, sys
+from io import open
def list_whence():
- with open('WHENCE') as whence:
+ with open('WHENCE', encoding='utf-8') as whence:
for line in whence:
match = re.match(r'(?:File|Source):\s*"(.*)"', line)
if match:
--
2.25.0.265.gbab2e86ba0-goog
next reply other threads:[~2020-02-29 2:15 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2020-02-29 2:15 Brian Norris [this message]
2020-03-02 13:07 ` [PATCH linux-firmware] check_whence: python3/utf-8 support Josh Boyer
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=20200229021505.143663-1-briannorris@chromium.org \
--to=briannorris@chromium.org \
--cc=linux-firmware@kernel.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 NNTP newsgroup(s).