ruby-changes:46883
From: nobu <ko1@a...>
Date: Fri, 2 Jun 2017 13:32:52 +0900 (JST)
Subject: [ruby-changes:46883] nobu:r58998 (trunk): test_require.rb: fallback encoding
nobu 2017-06-02 13:32:47 +0900 (Fri, 02 Jun 2017) New Revision: 58998 https://svn.ruby-lang.org/cgi-bin/viewvc.cgi?view=revision&revision=58998 Log: test_require.rb: fallback encoding * test/ruby/test_require.rb (assert_require_nonascii_path): fallback when LANG=C. Modified files: trunk/test/ruby/test_require.rb Index: test/ruby/test_require.rb =================================================================== --- test/ruby/test_require.rb (revision 58997) +++ test/ruby/test_require.rb (revision 58998) @@ -124,7 +124,8 @@ class TestRequire < Test::Unit::TestCase https://github.com/ruby/ruby/blob/trunk/test/ruby/test_require.rb#L124 if SECURITY_WARNING File.chmod(0777, File.dirname(require_path)) require_path.untaint - ospath = require_path.encode('filesystem') + ospath = (require_path.encode('filesystem') rescue + require_path.encode(self.class.ospath_encoding(require_path))) assert_warn(/Insecure world writable dir/) do assert_raise_with_message(SecurityError, "loading from unsafe path #{ospath}") do SECURITY_WARNING.call(require_path) -- ML: ruby-changes@q... Info: http://www.atdot.net/~ko1/quickml/