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: AS31976 209.132.180.0/23 X-Spam-Status: No, score=-4.0 required=3.0 tests=AWL,BAYES_00,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_EF,HEADER_FROM_DIFFERENT_DOMAINS, MAILING_LIST_MULTI,RCVD_IN_DNSWL_MED,SPF_HELO_PASS,SPF_PASS shortcircuit=no autolearn=ham autolearn_force=no version=3.4.2 Received: from sourceware.org (server1.sourceware.org [209.132.180.131]) (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 BF8BB20248 for ; Thu, 14 Mar 2019 19:19:17 +0000 (UTC) DomainKey-Signature: a=rsa-sha1; c=nofws; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; q=dns; s=default; b=t7C3WgGhtPVxJGDe BBtFBeaAdEYrSoed2NpBsQFKi1P9rFoBQjGByq01v+3j8gmkHg3nGa8VaO9Sz6tJ pVkcNUlJ1y4wjWe/WGelWJr5nspGjMYjxo9JifK0xmMR53jTD0WoR/73hpdV5Kdp H3Y36VooXauTB6It4T7PrD7VWUU= DKIM-Signature: v=1; a=rsa-sha1; c=relaxed; d=sourceware.org; h=list-id :list-unsubscribe:list-subscribe:list-archive:list-post :list-help:sender:subject:to:references:from:message-id:date :mime-version:in-reply-to:content-type :content-transfer-encoding; s=default; bh=UxxdYhJ6raJbLB0efn4chW +m6sM=; b=d09oNvHGpTcpE3fxBJHUgOufcYG6XpCGOAR9FjsKkqXaarAWHPV8vE k7MWo1RRloxknypuW253jYC4rQR44VrCuWduJz5qExXS4Qm2uYewOAD1aZImDHDi WI2g7DjQ5hKMetXlNFxhJ77AL1K687UWaLegWJ8n5P8YBOTFtZIss= Received: (qmail 89090 invoked by alias); 14 Mar 2019 19:19:15 -0000 Mailing-List: contact libc-alpha-help@sourceware.org; run by ezmlm Precedence: bulk List-Id: List-Unsubscribe: List-Subscribe: List-Archive: List-Post: List-Help: , Sender: libc-alpha-owner@sourceware.org Received: (qmail 89080 invoked by uid 89); 14 Mar 2019 19:19:15 -0000 Authentication-Results: sourceware.org; auth=none X-HELO: mail-qt1-f169.google.com Subject: Re: [PATCH COMMITTED] scripts/check-obsolete-constructs.py: Process all headers as UTF-8. To: Zack Weinberg , libc-alpha@sourceware.org References: <20190314134911.8160-1-zackw@panix.com> From: Carlos O'Donell Openpgp: preference=signencrypt Message-ID: <43fe2d57-b744-34d6-d320-ff92f5f87c66@redhat.com> Date: Thu, 14 Mar 2019 15:19:08 -0400 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:60.0) Gecko/20100101 Thunderbird/60.5.1 MIME-Version: 1.0 In-Reply-To: <20190314134911.8160-1-zackw@panix.com> Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 8bit On 3/14/19 9:49 AM, Zack Weinberg wrote: > A few of our installed headers contain UTF-8 in comments. > check-obsolete-constructs opened files without explicitly specifying > their encoding, so it would barf on these headers if “make check” was > run in a non-UTF-8 locale. > > * scripts/check-obsolete-constructs.py (HeaderChecker.check): > Specify encoding="utf-8" when opening headers to check. > --- > ChangeLog | 5 +++++ > scripts/check-obsolete-constructs.py | 2 +- > 2 files changed, 6 insertions(+), 1 deletion(-) > > diff --git a/ChangeLog b/ChangeLog > index f2cdcd7a66..f0281e5d10 100644 > --- a/ChangeLog > +++ b/ChangeLog > @@ -1,3 +1,8 @@ > +2019-03-14 Zack Weinberg > + > + * scripts/check-obsolete-constructs.py (HeaderChecker.check): > + Specify encoding="utf-8" when opening headers to check. > + > 2019-03-13 Joseph Myers > > * scripts/build-many-glibcs.py (Context.checkout): Default Linux > diff --git a/scripts/check-obsolete-constructs.py b/scripts/check-obsolete-constructs.py > index ce5c72251f..89d21dea6e 100755 > --- a/scripts/check-obsolete-constructs.py > +++ b/scripts/check-obsolete-constructs.py > @@ -437,7 +437,7 @@ class HeaderChecker: > def check(self, fname): > self.fname = fname > try: > - with open(fname, "rt") as fp: > + with open(fname, "rt", encoding="utf-8") as fp: > contents = fp.read() > except OSError as e: > sys.stderr.write("{}: {}\n".format(fname, e.strerror)) > Thanks for fixing this! -- Cheers, Carlos.