[ruby-core:96062] [Ruby master Bug#16391] Dir.pwd, Dir[] pathname case inconsistency

[email protected]
Newsgroups gmane.comp.lang.ruby.core
Message-ID <redmine.issue-16391.20191202183315.12f2965976c1c092@ruby-lang.org>
Issue #16391 has been reported by dbuck (Dave Buck).

----------------------------------------
Bug #16391: Dir.pwd, Dir[] pathname case inconsistency
https://bugs.ruby-lang.org/issues/16391

* Author: dbuck (Dave Buck)
* Status: Open
* Priority: Normal
* Assignee: 
* Target version: 
* ruby -v: ruby 2.6.5p114 (2019-10-01 revision 67812) [x64-mingw32]
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN
----------------------------------------
Directory globbing case sensitivity is os-dependent
(https://ruby-doc.org/core-2.6.5/Dir.html, glob,
"Case sensitivity depends on your system");
On Windows 10, directory globbing is case insensitive,
and may return glob matches that do
not match the case of the query.
Unfortunately, File.fnmatch seems to be case sensitive,
so this is not a workaround.

Expected:
If Dir.pwd => 'C:/users/dave/Documents' (lower case for users)
then Dir[Dir.pwd+'/*'] => ['C:/users/dave/Documents/...',...]
(lower case for users), not [C:/Users/dave/Documents/...',...] (upper case Users)

Impact:
Rails 6.0 Activeview implementation has an assumption that
case in pwd will match that in glob

---Files--------------------------------
dlbdirbug.rb (1.65 KB)


-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:[email protected]?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.