Project

General

Profile

Bug #12652

For Dir.home encode passed user

Added by davispuh (Dāvis Mosāns) over 3 years ago. Updated about 3 years ago.

Status:
Closed
Priority:
Normal
Target version:
-
ruby -v:
ruby 2.4.0dev (2016-08-03 trunk 55810) [x64-mswin64_140]
[ruby-core:76682]

Description

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.

user = ENV['USER']
puts Dir.home(user)

fails with

`home': user Dāvis 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) 0001-For-Dir.home-encode-passed-user.patch davispuh (Dāvis Mosāns), 08/03/2016 04:27 PM

Associated revisions

Revision 54a6cd84
Added by naruse (Yui NARUSE) about 3 years ago

  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56600 b2dd03c8-39d4-4d8f-98ff-823fe69b080e

Revision 56600
Added by naruse (Yui NARUSE) about 3 years ago

  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

Revision 56600
Added by naruse (Yui NARUSE) about 3 years ago

  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

Revision 56600
Added by naruse (Yui NARUSE) about 3 years ago

  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

Revision 56600
Added by naruse (Yui NARUSE) about 3 years ago

  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

History

Updated by shyouhei (Shyouhei Urabe) about 3 years ago

  • Assignee set to naruse (Yui NARUSE)
  • Status changed from Open to Assigned
#2

Updated by naruse (Yui NARUSE) about 3 years ago

  • Status changed from Assigned to Closed

Applied in changeset r56600.


  • file.c (rb_home_dir_of): convert given username into filesystem encoding. [ruby-core:76682] [Bug #12652] patched by Dāvis Mosāns

Also available in: Atom PDF