From d688ed9ea44f03fce0ae420f4fd6a2409d99c46a Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 17 Jun 2021 09:09:16 -0700 Subject: [PATCH] Add Errno::EINVAL to list of ignored errors This error can occur on Windows for certain filenames on certain code pages. Fixes [Bug #14591] --- lib/find.rb | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/find.rb b/lib/find.rb index 3f54cf6..9bee99c 100644 --- a/lib/find.rb +++ b/lib/find.rb @@ -49,14 +49,14 @@ def find(*paths, ignore_error: true) # :yield: path 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