From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on dcvr.yhbt.net X-Spam-Level: X-Spam-ASN: AS22989 209.51.188.0/24 X-Spam-Status: No, score=-3.9 required=3.0 tests=AWL,BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED, RCVD_IN_MSPIKE_H2,SPF_HELO_NONE,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from lists.gnu.org (lists.gnu.org [209.51.188.17]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by dcvr.yhbt.net (Postfix) with ESMTPS id 816291F4C0 for ; Thu, 31 Oct 2019 10:01:24 +0000 (UTC) Received: from localhost ([::1]:47980 helo=lists1p.gnu.org) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQ7Ga-00062b-K8 for e@80x24.org; Thu, 31 Oct 2019 06:01:20 -0400 Received: from eggs.gnu.org ([2001:470:142:3::10]:37809) by lists.gnu.org with esmtp (Exim 4.90_1) (envelope-from ) id 1iQ7GQ-0005pQ-Oz for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:15 -0400 Received: from Debian-exim by eggs.gnu.org with spam-scanned (Exim 4.71) (envelope-from ) id 1iQ7GP-0005X8-PA for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:10 -0400 Received: from dcvr.yhbt.net ([64.71.152.64]:37372) by eggs.gnu.org with esmtps (TLS1.0:DHE_RSA_AES_256_CBC_SHA1:32) (Exim 4.71) (envelope-from ) id 1iQ7GP-0005Ti-Js for dtas-all@nongnu.org; Thu, 31 Oct 2019 06:01:09 -0400 Received: from localhost (dcvr.yhbt.net [127.0.0.1]) by dcvr.yhbt.net (Postfix) with ESMTP id 681B11F4C3 for ; Thu, 31 Oct 2019 10:00:55 +0000 (UTC) From: Eric Wong To: dtas-all@nongnu.org Subject: [PATCH 2/3] dtas-console: pass kwargs as-is to String#encode Date: Thu, 31 Oct 2019 10:00:53 +0000 Message-Id: <20191031100054.13415-3-e@80x24.org> In-Reply-To: <20191031100054.13415-1-e@80x24.org> References: <20191031100054.13415-1-e@80x24.org> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable X-detected-operating-system: by eggs.gnu.org: GNU/Linux 2.2.x-3.x [generic] [fuzzy] X-Received-From: 64.71.152.64 X-BeenThere: dtas-all@nongnu.org X-Mailman-Version: 2.1.23 Precedence: list List-Id: duct tape audio suite List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dtas-all-bounces+e=80x24.org@nongnu.org Sender: "dtas-all" Ruby 2.7.0dev will warn when hashes are passed and intended for use as kwargs unless we expand the hash via "**enc_opts", but "**" is Ruby 2.0+ syntax and I guess we still support 1.9.3 for the time being. --- bin/dtas-console | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/bin/dtas-console b/bin/dtas-console index 877c9c4..2143e65 100755 --- a/bin/dtas-console +++ b/bin/dtas-console @@ -119,7 +119,6 @@ def may_fail(res, events) pre_mute_vol =3D 1.0 enc_locale =3D Encoding.find("locale") $stdout.set_encoding(enc_locale) -enc_opts =3D { undef: :replace, invalid: :replace, replace: '?' } begin Curses.init_screen Curses.nonl @@ -165,7 +164,8 @@ def may_fail(res, events) # FS encoding !=3D locale encoding, but we need to display an FS p= ath # name to whatever locale the terminal is encoded to, so force it # and risk mojibake... - infile.encode(enc_locale, enc_opts) + infile.encode(enc_locale, + undef: :replace, invalid: :replace, replace: '?') Curses.setpos(lineno +=3D 1, 0) Curses.clrtoeol Curses.addstr(infile)