Linux-Firmware Archive on lore.kernel.org
 help / color / Atom feed
* [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	[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, back to index

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

Linux-Firmware Archive on lore.kernel.org

Archives are clonable:
	git clone --mirror https://lore.kernel.org/linux-firmware/0 linux-firmware/git/0.git

	# If you have public-inbox 1.1+ installed, you may
	# initialize and index your mirror using the following commands:
	public-inbox-init -V2 linux-firmware linux-firmware/ https://lore.kernel.org/linux-firmware \
		linux-firmware@kernel.org
	public-inbox-index linux-firmware

Example config snippet for mirrors

Newsgroup available over NNTP:
	nntp://nntp.lore.kernel.org/org.kernel.lore.linux-firmware


AGPL code for this site: git clone https://public-inbox.org/public-inbox.git