Skip to content

Commit

Permalink
GH-39074: [Release][Packaging] Use UTF-8 explicitly for KEYS (#39082)
Browse files Browse the repository at this point in the history
### 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]>
  • Loading branch information
kou authored and raulcd committed Dec 9, 2023
1 parent 9123615 commit 7a54881
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 7a54881

Please sign in to comment.