From: nobu@... Date: 2018-01-27T05:45:42+00:00 Subject: [ruby-core:85149] [Ruby trunk Bug#14406][Rejected] File.expand_path doesn't expand tilde inside Windows home directory Issue #14406 has been updated by nobu (Nobuyoshi Nakada). Description updated Status changed from Open to Rejected abotalov (Andrei Botalov) wrote: > TMP environment variable on Windows is set to a name that contains a tilde. "Containing" doesn't mean "starting with". > ~~~ ruby > irb(main):085:0> File.expand_path(Dir.tmpdir) > => "C:/Users/ANDREI~1/AppData/Local/Temp" > irb(main):086:0> File.absolute_path(Dir.tmpdir) > => "C:/Users/ANDREI~1/AppData/Local/Temp" > ~~~ These contain a tilde, but do *not* start with. ---------------------------------------- Bug #14406: File.expand_path doesn't expand tilde inside Windows home directory https://bugs.ruby-lang.org/issues/14406#change-69885 * Author: abotalov (Andrei Botalov) * Status: Rejected * Priority: Normal * Assignee: * Target version: * ruby -v: 2.5.0 * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- TMP environment variable on Windows is set to a name that contains a tilde. `File.expand_path` doesn't currently return an expanded name. I would expect it to do so as its documentation says: "Converts a pathname to an absolute pathname." "The given pathname may start with a ���~���, which expands to the process owner's home directory" Example on my system: ~~~ ruby irb(main):085:0> File.expand_path(Dir.tmpdir) => "C:/Users/ANDREI~1/AppData/Local/Temp" irb(main):086:0> File.absolute_path(Dir.tmpdir) => "C:/Users/ANDREI~1/AppData/Local/Temp" ~~~ -- https://bugs.ruby-lang.org/ Unsubscribe: