From: takashikkbn@... Date: 2018-12-29T06:11:34+00:00 Subject: [ruby-core:90789] [Ruby trunk Bug#15478] [RFC] erb: remove deprecation warnings from ERB.new Issue #15478 has been updated by k0kubun (Takashi Kokubun). > nil and 0 $SAFE is already no-op, already, right? I don't care about $SAFE, so I would expect people will pass nil or 0 when they don't care (because they need to pass the other legacy variables). > > > Note that we already showed this deprecation warning on warnlevel == 2 on Ruby 2.6. > > Yeah, so if $SAFE already warns, I don't think ERB should also need to warn. I think you misunderstand that we're warning here only for $SAFE deprecation. Once $SAFE is eliminated, why would we leave the second argument for setting safe_level? The purpose of this warning is to eliminate the second argument of ERB.new. Passing nil and 0 will be harmful when the argument does not exist anymore. Also note that I actually meant that it's fine to combine multiple warnings to one line by "Stop showing warnings for legacy_trim_mode and legacy_eoutvar is fine", and still the third/fourth arguments are expected to go away. > I hit this at: > https://80x24.org/olddoc.git/tree/lib/oldweb.rb?h=v1.5.1#n272 Thanks. Shall I send a patch to fix it? > Most code repositories are NOT public; and we can never know all or even most of them. By now, I believe deprecating existing/stable APIs gracefully in scripting languages is impossible without either making users angry or wasting their time with churn. I get your point. I actually faced this by myself at my company's private code. At the same time, it should be only acceptable on a major version upgrade as long as we provide a way to gracefully migrate from old interface to new interface and notify users gradually. Starting from warn level 2 in Ruby 2.6, decreasing it to 1 in Ruby 2.7, and changing the behavior on Ruby 3.0 should be fine in that sense. > If anything, such warning should go to syslog (or an out-of-the-way OS-level logging mechanism). Stderr is too annoying to ordinary users (not programmers). I agree that non programmers wouldn't see syslog and it would not annoy them. But do you think programmers always see syslog when they execute Ruby? I don't think so because I only see it when something strange happens. I believe annoying users by suggesting to fix the usage first is far better than immediately breaking it at some point with just ArgumentError which has almost no clue to fix it immediately. ---------------------------------------- Bug #15478: [RFC] erb: remove deprecation warnings from ERB.new https://bugs.ruby-lang.org/issues/15478#change-75965 * Author: normalperson (Eric Wong) * Status: Feedback * Priority: Normal * Assignee: k0kubun (Takashi Kokubun) * Target version: * ruby -v: * Backport: 2.4: UNKNOWN, 2.5: UNKNOWN, 2.6: UNKNOWN ---------------------------------------- erb: remove deprecation warnings from ERB.new There's too much code relying on the old ordering; so any deprecation or removal of the old way is too annoying and only serves to make users angry. ---Files-------------------------------- 0001-erb-remove-deprecation-warnings-from-ERB.new.patch (2.87 KB) -- https://bugs.ruby-lang.org/ Unsubscribe: