Skip to content

Commit

Permalink
apacheGH-39074: [Release][Packaging] Use UTF-8 explicitly for KEYS (a…
Browse files Browse the repository at this point in the history
…pache#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: apache#39074

Authored-by: Sutou Kouhei <kou@clear-code.com>
Signed-off-by: Sutou Kouhei <kou@clear-code.com>
  • Loading branch information
kou authored and dgreiss committed Feb 17, 2024
1 parent c6c7b64 commit 4748061
Showing 1 changed file with 1 addition and 1 deletion.
2 changes: 1 addition & 1 deletion dev/tasks/linux-packages/apache-arrow-release/Rakefile
Original file line number Diff line number Diff line change
Expand Up @@ -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 = [
Expand Down

0 comments on commit 4748061

Please sign in to comment.