From 47480612fbe009ece799e757cc77b498f944e105 Mon Sep 17 00:00:00 2001 From: Sutou Kouhei Date: Wed, 6 Dec 2023 08:51:19 +0900 Subject: [PATCH] GH-39074: [Release][Packaging] Use UTF-8 explicitly for KEYS (#39082) ### Rationale for this change `KEYS` may have UTF-8 (non ASCII) characters. Ruby chooses the default encoding based on `LANG`. If `LANG=C`, Ruby uses the `US-ASCII` encoding as the default encoding. If Ruby uses the `US-ASCII` encoding, we can't process `KEYS` because it has non ASCII characters. ### What changes are included in this PR? Use the `UTF-8` encoding explicitly for `KEYS`. If we specify the `UTF-8` encoding explicitly, our `KEYS` processing don't depend on `LANG`. ### Are these changes tested? Yes. ### Are there any user-facing changes? No. * Closes: #39074 Authored-by: Sutou Kouhei Signed-off-by: Sutou Kouhei --- dev/tasks/linux-packages/apache-arrow-release/Rakefile | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/dev/tasks/linux-packages/apache-arrow-release/Rakefile b/dev/tasks/linux-packages/apache-arrow-release/Rakefile index 896e4adf4679e..b7e1c87d13650 100644 --- a/dev/tasks/linux-packages/apache-arrow-release/Rakefile +++ b/dev/tasks/linux-packages/apache-arrow-release/Rakefile @@ -43,7 +43,7 @@ class ApacheArrowReleasePackageTask < PackageTask keys_path = "#{@archive_base_name}/KEYS" download("https://www.apache.org/dyn/closer.lua?action=download&filename=arrow/KEYS", keys_path) - keys = File.read(keys_path) + keys = File.read(keys_path, encoding: "UTF-8") File.open(keys_path, "w") do |keys_file| is_ed25519_key = false deny_lists = [