[2/3] localedata/unicode-gen/utf8_gen.py: adapt regexp to get relevant lines from EastAsianWidth.txt

Message ID 20230915094038.1178807-2-mfabian@redhat.com
State Committed
Commit 71de3aead9fffe89556e80ebc94aa918d8ee7bca
Delegated to: Mike Fabian
Headers
Series [1/3] Fix regexp syntax warnings in localedata/unicode-gen/ctype_compatibility.py |

Checks

Context Check Description
redhat-pt-bot/TryBot-apply_patch success Patch applied to master at the time it was sent
linaro-tcwg-bot/tcwg_glibc_build--master-aarch64 success Testing passed
linaro-tcwg-bot/tcwg_glibc_build--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_check--master-arm warning Patch is already merged
linaro-tcwg-bot/tcwg_glibc_check--master-aarch64 warning Patch is already merged

Commit Message

Mike FABIAN Sept. 15, 2023, 9:40 a.m. UTC
  ---
 localedata/unicode-gen/utf8_gen.py | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Carlos O'Donell Sept. 15, 2023, 11:52 a.m. UTC | #1
On 9/15/23 05:40, Mike FABIAN wrote:

LGTM. Please commit.

Reviewed-by: Carlos O'Donell <carlos@redhat.com>

> ---
>  localedata/unicode-gen/utf8_gen.py | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/localedata/unicode-gen/utf8_gen.py b/localedata/unicode-gen/utf8_gen.py
> index b48dc2aaa4..117c5a9652 100755
> --- a/localedata/unicode-gen/utf8_gen.py
> +++ b/localedata/unicode-gen/utf8_gen.py
> @@ -350,7 +350,7 @@ if __name__ == "__main__":
>              # the EastAsianWidth.txt file.
>              if re.match(r'.*<reserved-.+>\.\.<reserved-.+>.*', LINE):
>                  continue
> -            if re.match(r'^[^;]*;[WF]', LINE):
> +            if re.match(r'^[^;]*;\s*[WF]\s*', LINE):
>                  EAST_ASIAN_WIDTH_LINES.append(LINE.strip())
>      with open(ARGS.prop_list_file, mode='r') as PROP_LIST_FILE:
>          PROP_LIST_LINES = []
  

Patch

diff --git a/localedata/unicode-gen/utf8_gen.py b/localedata/unicode-gen/utf8_gen.py
index b48dc2aaa4..117c5a9652 100755
--- a/localedata/unicode-gen/utf8_gen.py
+++ b/localedata/unicode-gen/utf8_gen.py
@@ -350,7 +350,7 @@  if __name__ == "__main__":
             # the EastAsianWidth.txt file.
             if re.match(r'.*<reserved-.+>\.\.<reserved-.+>.*', LINE):
                 continue
-            if re.match(r'^[^;]*;[WF]', LINE):
+            if re.match(r'^[^;]*;\s*[WF]\s*', LINE):
                 EAST_ASIAN_WIDTH_LINES.append(LINE.strip())
     with open(ARGS.prop_list_file, mode='r') as PROP_LIST_FILE:
         PROP_LIST_LINES = []