Skip to content

Commit 0a474d1

Browse files
committed
Add Errno::EINVAL to list of ignored errors
This error can occur on Windows for certain filenames on certain code pages. Fixes [Bug #14591]
1 parent 79bc215 commit 0a474d1

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

lib/find.rb

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -49,14 +49,14 @@ def find(*paths, ignore_error: true) # :yield: path
4949
yield file.dup
5050
begin
5151
s = File.lstat(file)
52-
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
52+
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
5353
raise unless ignore_error
5454
next
5555
end
5656
if s.directory? then
5757
begin
5858
fs = Dir.children(file, encoding: enc)
59-
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG
59+
rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL
6060
raise unless ignore_error
6161
next
6262
end

0 commit comments

Comments
 (0)