[ruby-core:76682] [Ruby trunk Bug#12652] For Dir.home encode passed user
From:
davispuh@...
Date:
2016-08-03 16:28:59 UTC
List:
ruby-core #76682
Issue #12652 has been reported by Dト」is Mosト]s. ---------------------------------------- Bug #12652: For Dir.home encode passed user https://bugs.ruby-lang.org/issues/12652 * Author: Dト」is Mosト]s * Status: Open * Priority: Normal * Assignee: * ruby -v: ruby 2.4.0dev (2016-08-03 trunk 55810) [x64-mswin64_140] * Backport: 2.1: UNKNOWN, 2.2: UNKNOWN, 2.3: UNKNOWN ---------------------------------------- Currently Dir.home(user) expects that passed user will be already in appropriate encoding but if it's not it will fail because comparing with different encodings. This causes TestDir#test_home to fail. ~~~ruby user = ENV['USER'] puts Dir.home(user) ~~~ fails with ~~~ `home': user Dト」is doesn't exist (ArgumentError) ~~~ On Linux it will fail too if passed user is in different encoding than locale. I've attached a patch which fixes this. ---Files-------------------------------- 0001-For-Dir.home-encode-passed-user.patch (1.24 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe> <http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>