From 230111802c2b9dcb8f391b489ff52a9dc0b41b87 Mon Sep 17 00:00:00 2001 From: Jeremy Evans Date: Thu, 17 Jun 2021 09:09:16 -0700 Subject: [PATCH] [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 --- lib/find.rb | 4 ++-- 1 file 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