aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJeremy Evans <code@jeremyevans.net>2021-06-17 09:09:16 -0700
committerHiroshi SHIBATA <hsbt@ruby-lang.org>2021-07-27 21:20:31 +0900
commit230111802c2b9dcb8f391b489ff52a9dc0b41b87 (patch)
tree49f10ffe43c3b0a9323e64e37086a56f011059eb
parentacfec23becaa15936a00305f5742e74012b33e82 (diff)
downloadruby-230111802c2b9dcb8f391b489ff52a9dc0b41b87.tar.gz
[ruby/find] Add Errno::EINVAL to list of ignored errors
This error can occur on Windows for certain filenames on certain code pages. Fixes [Bug #14591] https://github.com/ruby/find/commit/0a474d1027
-rw-r--r--lib/find.rb4
1 files changed, 2 insertions, 2 deletions
diff --git a/lib/find.rb b/lib/find.rb
index 3f54cf6b93..9bee99c66d 100644
--- a/lib/find.rb
+++ b/lib/find.rb
@@ -49,14 +49,14 @@ module Find
yield file.dup
begin
s = File.lstat(file)
- rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
+ rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
raise unless ignore_error
next
end
if s.directory? then
begin
fs = Dir.children(file, encoding: enc)
- rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
+ rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
raise unless ignore_error
next
end