[#121215] [Ruby master Bug#21166] Fiber Scheduler is unable to be interrupted by `IO#close`. — "ioquatix (Samuel Williams) via ruby-core" <ruby-core@...>

Issue #21166 has been reported by ioquatix (Samuel Williams).

13 messages 2025/03/02

[#121222] [Ruby master Bug#21167] Visual Studio 2022 17.13.x couldn't build ruby.exe — "hsbt (Hiroshi SHIBATA) via ruby-core" <ruby-core@...>

Issue #21167 has been reported by hsbt (Hiroshi SHIBATA).

8 messages 2025/03/03

[#121234] [Ruby master Bug#21168] Prism doesn't require argument parentheses (in some cases) when a block is present but parse.y does — "Earlopain (Earlopain _) via ruby-core" <ruby-core@...>

Issue #21168 has been reported by Earlopain (Earlopain _).

8 messages 2025/03/04

[#121389] [Ruby Bug#21187] Strings concatenated with `\` getting frozen with literal hashes (PRISM only) — LocoDelAssembly via ruby-core <ruby-core@...>

Issue #21187 has been reported by LocoDelAssembly (Hern=E1n Pereira).

12 messages 2025/03/17

[#121413] [Ruby Bug#21193] Inherited callback returns `nil` for `Object.const_source_location` — "eileencodes (Eileen Uchitelle) via ruby-core" <ruby-core@...>

Issue #21193 has been reported by eileencodes (Eileen Uchitelle).

15 messages 2025/03/20

[#121451] [Ruby Bug#21201] Performance regression when defining methods inside `refine` blocks — "alpaca-tc (Hiroyuki Ishii) via ruby-core" <ruby-core@...>

Issue #21201 has been reported by alpaca-tc (Hiroyuki Ishii).

8 messages 2025/03/27

[ruby-core:121260] [Ruby master Feature#18784] `FileUtils.rm_f` and `FileUtils.rm_rf` should not mask exceptions

From: "Dan0042 (Daniel DeLorme) via ruby-core" <ruby-core@...>
Date: 2025-03-07 22:19:20 UTC
List: ruby-core #121260
Issue #18784 has been updated by Dan0042 (Daniel DeLorme).


It could also be an option like `FileUtils.rm(ignore_missing: true)`, that =
way it can apply to both `rm` and `rm_r`.

----------------------------------------
Feature #18784: `FileUtils.rm_f` and `FileUtils.rm_rf` should not mask exce=
ptions
https://bugs.ruby-lang.org/issues/18784#change-112215

* Author: deivid (David Rodr=EDguez)
* Status: Open
----------------------------------------
In recent times, I've been having issues with these methods because they do=
n't let you know when some issue happened while trying to remove the given =
folders/files.

IMO most users expect all pre-existing folders/files that are passed to the=
se methods to be actually removed by the methods. Instead, when this happen=
s, errors are silently swallowed and normally the result is that you will g=
et some other issue further down the road, making the problem hard to debug.

The current workaround I'm using is to double check whether the files still=
 exist after the method, and raise a custom error if they do, but I still c=
an't see the original problem, so issues are similarly hard to debug.

This is also a deviation from how `rm -rf` and `rm -f` work, since these to=
ols finish with a failure exit code when they fail to remove the given file=
s. Given that `fileutils` is intended to mimic shell functionality, I think=
 this is just a bug.

I think the intention of the `force` flag here is to:
* Don't prompt for confirmation.
* Ignore given arguments that are not files that already exist.

But any issue other than that should not be swallowed, and in general I thi=
nk the method should succeed if and only if the given list of file names do=
es not exist after the methods are done.

I think this is in line with the following note I get when I run `man rm`, =
but also suggests that this is not the standard behavior of "historical imp=
lementations"

> COMPATIBILITY
>
> The rm utility differs from historical implementations in that the -f opt=
ion only masks attempts to remove non-existent files instead of masking a l=
arge variety of errors.

I implemented this at https://github.com/ruby/fileutils/pull/58, but treati=
ng this as a bug. I can also implement a more conservative for approach for=
 users that might be using `FileUtils.rm_rf` or `FileUtils.rm_f` but don't =
really care if the files are removed or not.

Alternative proposals would be `FileUtils.rm_rf(force: strict)`, or `FileUt=
ils.strict_rm_rf`, but to be honest, if this is considered a breaking chang=
e, I would ship it as a new major version, and let users update their code =
to swallow errors themselves if they need to.

Happy to hear any feedback!



--=20
https://bugs.ruby-lang.org/
 ______________________________________________
 ruby-core mailing list -- ruby-core@ml.ruby-lang.org
 To unsubscribe send an email to ruby-core-leave@ml.ruby-lang.org
 ruby-core info -- https://ml.ruby-lang.org/mailman3/lists/ruby-core.ml.rub=
y-lang.org/


In This Thread