From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from wout5-smtp.messagingengine.com (wout5-smtp.messagingengine.com [64.147.123.21]) by sourceware.org (Postfix) with ESMTPS id 4FB5B3857030 for ; Thu, 24 Sep 2020 01:00:28 +0000 (GMT) DMARC-Filter: OpenDMARC Filter v1.3.2 sourceware.org 4FB5B3857030 Authentication-Results: sourceware.org; dmarc=none (p=none dis=none) header.from=serhei.io Authentication-Results: sourceware.org; spf=pass smtp.mailfrom=me@serhei.io Received: from compute7.internal (compute7.nyi.internal [10.202.2.47]) by mailout.west.internal (Postfix) with ESMTP id 7C932E06 for ; Wed, 23 Sep 2020 21:00:25 -0400 (EDT) Received: from imap21 ([10.202.2.71]) by compute7.internal (MEProxy); Wed, 23 Sep 2020 21:00:25 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=serhei.io; h= mime-version:message-id:date:from:to:subject:content-type; s= fm2; bh=7+ekhRXzyRG9p/rSqwuV1/3LwIraR4PAcM0bXgTtAuo=; b=TTu9rtEe EKfcUGfNFuZ2Iwa6Oxrhb/Pk4Kbs9fVP3+56HM9TEROeMvhayH5QmkjsfBP5KCqF S6W+G96VkeXlitE0jgo8r/ntQ+BYiAQseIuEDcdYet6B6hUJU9stW76n/IziB8e3 5w/mA2e11VaPsQXhXYrd7ainLa/ZfHXSll7+DZ0nLjpUq3uzOyrTmfYdFEd91Lxu zEEL4u1oO1B11N5wpy/QgeWn0Cd6Y9azz0lOtiGpSBfWwQDje8h6Nzm9qk2oJLat wPyLONHEOlHWj4hfhN1VW2f8bPLMeWxI4Dgwc7cxALhYDC0CHIVZ89reyvbO22k1 aVvAbgrJTUX40w== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=content-type:date:from:message-id :mime-version:subject:to:x-me-proxy:x-me-proxy:x-me-sender :x-me-sender:x-sasl-enc; s=fm3; bh=7+ekhRXzyRG9p/rSqwuV1/3LwIraR 4PAcM0bXgTtAuo=; b=KtN/vrcQ1JRwmkC4iorqjmnQaNAfv6tUaCGlG5AVS0ua2 78ZZU6/kZy1GqHbfq4HoHxDZbUiQK/eHaBqf47DeX+npECgMP+DaTxGJ7YnPLx8p oie7xYlZoemF+n2vOUXIInucccKDlkmsWbZ8a5+Ef2NvhQLCnto8PwTh1kJgiZUS RQBusJDjCalPoZO6Qevi+NbWLpeJ+t0/PgEMxH0JpZHWDUy4oPKX457O06Mk3EA2 0UQae9yNCtaSMPIlGYi3q3Nb+LXsceZPqvvLwehWXJpcLRe9WuLIStQu5pH3zph9 jfxCDftuLXfZQsNf1RSXb6m/W3tO5QvmB0C3068Pg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedujedrudejgdeflecutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecunecujfgurhepofgfggfkfffhvffutgesthdtredtre ertdenucfhrhhomhepfdfuvghrhhgvihcuofgrkhgrrhhovhdfuceomhgvsehsvghrhhgv ihdrihhoqeenucggtffrrghtthgvrhhnpefgveeuieejtdefvdegteeukedtueelfeehue duffdugfdutedtheeviedtleehffenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgr mhepmhgrihhlfhhrohhmpehmvgesshgvrhhhvghirdhioh X-ME-Proxy: Received: by mailuser.nyi.internal (Postfix, from userid 501) id 0259B660069; Wed, 23 Sep 2020 21:00:16 -0400 (EDT) X-Mailer: MessagingEngine.com Webmail Interface User-Agent: Cyrus-JMAP/3.3.0-355-g3ece53b-fm-20200922.004-g3ece53b9 Mime-Version: 1.0 x-forwarded-message-id: Message-Id: <97957952-514b-4186-9cac-93fe07517309@www.fastmail.com> Date: Wed, 23 Sep 2020 21:00:04 -0400 From: "Serhei Makarov" To: Bunsen Subject: Fwd: Re: [PATCH] Use binary mode to read .log/.sum Content-Type: text/plain X-Spam-Status: No, score=-8.7 required=5.0 tests=BAYES_00, DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, DKIM_VALID_EF, GIT_PATCH_0, JMQ_SPF_NEUTRAL, RCVD_IN_DNSWL_LOW, RCVD_IN_MSPIKE_H2, SPF_HELO_PASS, SPF_PASS, TXREP autolearn=ham autolearn_force=no version=3.4.2 X-Spam-Checker-Version: SpamAssassin 3.4.2 (2018-09-13) on server2.sourceware.org X-BeenThere: bunsen@sourceware.org X-Mailman-Version: 2.1.29 Precedence: list List-Id: Bunsen mailing list List-Unsubscribe: , List-Archive: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 24 Sep 2020 01:00:29 -0000 ----- Original message ----- From: Serhei Makarov To: Keith Seitz Subject: Re: [PATCH] Use binary mode to read .log/.sum Date: Wednesday, September 23, 2020 8:59 PM On Wed, Sep 23, 2020, at 5:06 PM, Keith Seitz via Bunsen wrote: > diff --git a/scripts-master/gdb/parse_dejagnu.py > b/scripts-master/gdb/parse_dejagnu.py > index 5218e9a..c9f30ac 100755 > --- a/scripts-master/gdb/parse_dejagnu.py > +++ b/scripts-master/gdb/parse_dejagnu.py > @@ -65,11 +65,14 @@ def get_outcome_line(testcase): > datestamp_format = '%a %b %d %H:%M:%S %Y' > > def openfile_or_xz(path): > + # Read in bary mode to suppress encoding problems that might occur > + # from reading gdb.{log,sum}. Sometimes inferiors or gdb can just output > + # garbage bytes. > if os.path.isfile(path): > - return open(path, mode='rt') > + return open(path, mode='rb') > elif os.path.isfile(path+'.xz'): > - return lzma.open(path+'.xz', mode='rt') > - return open(path, mode='rt') # XXX trigger default error > + return lzma.open(path+'.xz', mode='rb') > + return open(path, mode='rb') # XXX trigger default error Patch LGTM. In retrospect, the need to deal with encodings is a major annoyance about I/O in recent Python versions. I have had to make prior fixes for similar issues, and I'm unsurprised that there is still more to fix.