This is an automated email from the ASF dual-hosted git repository.

raulcd pushed a commit to branch maint-14.0.x
in repository https://gitbox.apache.org/repos/asf/arrow.git


The following commit(s) were added to refs/heads/maint-14.0.x by this push:
     new 7a54881c7c GH-39074: [Release][Packaging] Use UTF-8 explicitly for 
KEYS (#39082)
7a54881c7c is described below

commit 7a54881c7c25809de2556ed1a8f3c5db098eaf52
Author: Sutou Kouhei <[email protected]>
AuthorDate: Wed Dec 6 08:51:19 2023 +0900

    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 <[email protected]>
    Signed-off-by: Sutou Kouhei <[email protected]>
---
 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 dc2411f0de..19a0e4f915 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 = [

Reply via email to