* [PATCH linux-firmware] check_whence: python3/utf-8 support
@ 2020-02-29 2:15 Brian Norris
2020-03-02 13:07 ` Josh Boyer
0 siblings, 1 reply; 2+ messages in thread
From: Brian Norris @ 2020-02-29 2:15 UTC (permalink / raw)
To: linux-firmware; +Cc: Brian Norris
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
^ permalink raw reply related [flat|nested] 2+ messages in thread
* Re: [PATCH linux-firmware] check_whence: python3/utf-8 support
2020-02-29 2:15 [PATCH linux-firmware] check_whence: python3/utf-8 support Brian Norris
@ 2020-03-02 13:07 ` Josh Boyer
0 siblings, 0 replies; 2+ messages in thread
From: Josh Boyer @ 2020-03-02 13:07 UTC (permalink / raw)
To: Brian Norris; +Cc: Linux Firmware
On Fri, Feb 28, 2020 at 9:15 PM Brian Norris <briannorris@chromium.org> wrote:
>
> 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>
Both of your patches applied and pushed out. Thanks!
josh
> ---
> 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
>
^ permalink raw reply [flat|nested] 2+ messages in thread
end of thread, other threads:[~2020-03-02 13:07 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-02-29 2:15 [PATCH linux-firmware] check_whence: python3/utf-8 support Brian Norris
2020-03-02 13:07 ` Josh Boyer
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).