From f863bc505cf1a976aecd0ed3cb21a3a82956953e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada Date: Wed, 14 Sep 2022 11:05:43 +0900 Subject: [PATCH] [ruby/irb] Fix the error when LC_MESSAGES config value is nil https://github.com/ruby/irb/commit/6bbde84369 --- lib/irb/ext/save-history.rb | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/irb/ext/save-history.rb b/lib/irb/ext/save-history.rb index ad954c3558..2135184dba 100644 --- a/lib/irb/ext/save-history.rb +++ b/lib/irb/ext/save-history.rb @@ -113,7 +113,7 @@ module IRB append_history = true end - open(history_file, "#{append_history ? 'a' : 'w'}:#{IRB.conf[:LC_MESSAGES].encoding}", 0600) do |f| + File.open(history_file, (append_history ? 'a' : 'w'), 0o600, encoding: IRB.conf[:LC_MESSAGES]&.encoding) do |f| hist = history.map{ |l| l.split("\n").join("\\\n") } unless append_history begin