From: shevegen@... Date: 2018-03-08T22:23:27+00:00 Subject: [ruby-core:86059] [Ruby trunk Bug#14591] Files with invalid multi-byte characters will cause Find::find() to raise EINVAL exception Issue #14591 has been updated by shevegen (Robert A. Heiler). > rescue Errno::ENOENT, Errno::EACCES, Errno::ENOTDIR, Errno::ELOOP, Errno::ENAMETOOLONG, Errno::EINVAL > This seems a reasonable compromise for now I am not sure. It requires of ruby hackers to know all these various error types that they want to rescue. It's ok to be able to be very specific but perhaps it should not be so ... verbose. That's 6 entries! I suppose you don't want to "rescue Exception" in general but perhaps there could be some sub-range such as "rescue Errno" or something. Or perhaps an even more elegant way. IMO the above is not very elegant. I myself also have a very few situations where I rescue multiple exceptions, in particular related to internet-connection (querying a remote phpbb webforum ... so many things can go wrong and whenever I ran into a problem, I added that particular error... but at a later time, I wondered whether that was a good approach since it takes a LOT of specific error-catching...) ---------------------------------------- Bug #14591: Files with invalid multi-byte characters will cause Find::find() to raise EINVAL exception https://bugs.ruby-lang.org/issues/14591#change-70922 * Author: jeffgrover (Jeff Grover) * Status: Open * Priority: Normal * Assignee: * Target version: * ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [x64-mingw32] * Backport: 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN ---------------------------------------- This can be easily duplicated by the following simple program. I believe this is mostly going to be a problem for users on Windows, where Unicode filenames are common. The example below was the name of a real file in my Recycle Bin: First, create the problematic file: ~~~ c:\Users\me>copy con .������������000100000003f582f1e810a56094d18e File contents ^Z 1 file(s) copied. c:\Users\me>dir Volume in drive C is Windows Volume Serial Number is 64A1-A9E3 Directory of c:\Users\grove\Documents\Ruby 03/08/2018 07:18 AM