ruby-changes:73545
From: Nobuyoshi <ko1@a...>
Date: Wed, 14 Sep 2022 11:14:19 +0900 (JST)
Subject: [ruby-changes:73545] f863bc505c (master): [ruby/irb] Fix the error when LC_MESSAGES config value is nil
https://git.ruby-lang.org/ruby.git/commit/?id=f863bc505c From f863bc505cf1a976aecd0ed3cb21a3a82956953e Mon Sep 17 00:00:00 2001 From: Nobuyoshi Nakada <nobu@r...> Date: Wed, 14 Sep 2022 11:05:43 +0900 Subject: [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 https://github.com/ruby/ruby/blob/trunk/lib/irb/ext/save-history.rb#L113 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 -- cgit v1.2.1 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/