ruby-changes:61895
From: Kazuhiro <ko1@a...>
Date: Mon, 22 Jun 2020 18:18:33 +0900 (JST)
Subject: [ruby-changes:61895] 7ac6c967e4 (master): Revert d231b8f95b35d8a344cec4f62d7bbdf360a70e1c and add debug print
https://git.ruby-lang.org/ruby.git/commit/?id=7ac6c967e4 From 7ac6c967e49d1e3ad46be20aca98e8f1df2c2d5b Mon Sep 17 00:00:00 2001 From: Kazuhiro NISHIYAMA <zn@m...> Date: Mon, 22 Jun 2020 18:15:21 +0900 Subject: Revert d231b8f95b35d8a344cec4f62d7bbdf360a70e1c and add debug print diff --git a/lib/fileutils.rb b/lib/fileutils.rb index 371a348..438f321 100644 --- a/lib/fileutils.rb +++ b/lib/fileutils.rb @@ -1287,11 +1287,7 @@ module FileUtils https://github.com/ruby/ruby/blob/trunk/lib/fileutils.rb#L1287 def entries opts = {} - if fu_windows? && ::Encoding.compatible?(::Encoding::UTF_8, path.encoding) - opts[:encoding] = ::Encoding::UTF_8 - else - opts[:encoding] = path.encoding - end + opts[:encoding] = fu_windows? ? ::Encoding::UTF_8 : path.encoding files = if Dir.respond_to?(:children) Dir.children(path, **opts) diff --git a/test/fileutils/test_fileutils.rb b/test/fileutils/test_fileutils.rb index 8a546cc..31973bf 100644 --- a/test/fileutils/test_fileutils.rb +++ b/test/fileutils/test_fileutils.rb @@ -770,7 +770,10 @@ class TestFileUtils < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/fileutils/test_fileutils.rb#L770 File.write("#{dir}/#{c}.txt", "test_remove_entry_multibyte_path") remove_entry dir - assert_file_not_exist dir + assert_no_file_exist dir + rescue MiniTest::Assertion + STDERR.puts Dir.glob("#{dir}/**").inspect + raise end def test_remove_entry_secure -- cgit v0.10.2 -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/