From 311e6503348972f934e773b02c1694d813b65968 Mon Sep 17 00:00:00 2001 From: nobu Date: Fri, 2 Jun 2017 04:32:47 +0000 Subject: [PATCH] test_require.rb: fallback encoding * test/ruby/test_require.rb (assert_require_nonascii_path): fallback when LANG=C. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@58998 b2dd03c8-39d4-4d8f-98ff-823fe69b080e --- test/ruby/test_require.rb | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/test/ruby/test_require.rb b/test/ruby/test_require.rb index 2e62300281..128a8ce8d0 100644 --- a/test/ruby/test_require.rb +++ b/test/ruby/test_require.rb @@ -124,7 +124,8 @@ class TestRequire < Test::Unit::TestCase 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)