From nobody Mon Apr 29 15:16:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521223824477650.9706959673648; Fri, 16 Mar 2018 11:10:24 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.11]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id D96DE2821D; Fri, 16 Mar 2018 18:10:22 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx02.intmail.prod.int.phx2.redhat.com [10.5.11.21]) by smtp.corp.redhat.com (Postfix) with ESMTPS id BCFAB600D1; Fri, 16 Mar 2018 18:10:20 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 658904CA99; Fri, 16 Mar 2018 18:10:19 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2GI5PKn000455 for ; Fri, 16 Mar 2018 14:05:25 -0400 Received: by smtp.corp.redhat.com (Postfix) id 7FC8D5D72D; Fri, 16 Mar 2018 18:05:25 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-116-212.phx2.redhat.com [10.3.116.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id E11EC5D72A; Fri, 16 Mar 2018 18:05:24 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 16 Mar 2018 14:05:11 -0400 Message-Id: <2ea88b534bc8b763b5d56e181c94ee7662d35414.1521222704.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH 1/2] apibuild: Fix errors on python3 X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.11 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.30]); Fri, 16 Mar 2018 18:10:23 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Module 'string' function lower doesn't exist in python3. The canonical way is to call .lower() on a str instance. Do that, and make the exception handling more specific, which would have made this issue obvious. Signed-off-by: Cole Robinson Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/apibuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index 67b7eed1e..e81980e3c 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -2326,10 +2326,10 @@ class docBuilder: for data in ('Summary', 'Description', 'Author'): try: output.write(" <%s>%s\n" % ( - string.lower(data), + data.lower(), escape(dict.info[data]), - string.lower(data))) - except: + data.lower())) + except KeyError: self.warning("Header %s lacks a %s description" % (mod= ule, data)) if 'Description' in dict.info: desc =3D dict.info['Description'] --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list From nobody Mon Apr 29 15:16:10 2024 Delivered-To: importer@patchew.org Received-SPF: pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; envelope-from=libvir-list-bounces@redhat.com; helo=mx1.redhat.com; Authentication-Results: mx.zohomail.com; spf=pass (zoho.com: domain of redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass(p=none dis=none) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com [209.132.183.28]) by mx.zohomail.com with SMTPS id 1521223954412336.15139347229774; Fri, 16 Mar 2018 11:12:34 -0700 (PDT) Received: from smtp.corp.redhat.com (int-mx03.intmail.prod.int.phx2.redhat.com [10.5.11.13]) (using TLSv1.2 with cipher AECDH-AES256-SHA (256/256 bits)) (No client certificate requested) by mx1.redhat.com (Postfix) with ESMTPS id BF83283F45; Fri, 16 Mar 2018 18:12:32 +0000 (UTC) Received: from colo-mx.corp.redhat.com (colo-mx01.intmail.prod.int.phx2.redhat.com [10.5.11.20]) by smtp.corp.redhat.com (Postfix) with ESMTPS id 9120D6A043; Fri, 16 Mar 2018 18:12:32 +0000 (UTC) Received: from lists01.pubmisc.prod.ext.phx2.redhat.com (lists01.pubmisc.prod.ext.phx2.redhat.com [10.5.19.33]) by colo-mx.corp.redhat.com (Postfix) with ESMTP id 58D67181B9FB; Fri, 16 Mar 2018 18:12:32 +0000 (UTC) Received: from smtp.corp.redhat.com (int-mx04.intmail.prod.int.phx2.redhat.com [10.5.11.14]) by lists01.pubmisc.prod.ext.phx2.redhat.com (8.13.8/8.13.8) with ESMTP id w2GI5RDi000467 for ; Fri, 16 Mar 2018 14:05:27 -0400 Received: by smtp.corp.redhat.com (Postfix) id 35ACC5D725; Fri, 16 Mar 2018 18:05:27 +0000 (UTC) Received: from worklaptop.redhat.com (ovpn-116-212.phx2.redhat.com [10.3.116.212]) by smtp.corp.redhat.com (Postfix) with ESMTP id C3CAA5D72A; Fri, 16 Mar 2018 18:05:25 +0000 (UTC) From: Cole Robinson To: libvirt-list@redhat.com Date: Fri, 16 Mar 2018 14:05:12 -0400 Message-Id: <1e60444afa0362390d4e61e483e874302d1e98ec.1521222704.git.crobinso@redhat.com> In-Reply-To: References: In-Reply-To: References: X-Scanned-By: MIMEDefang 2.79 on 10.5.11.14 X-loop: libvir-list@redhat.com Cc: Andrea Bolognani Subject: [libvirt] [PATCH 2/2] apibuild: Fix -refs.xml building X-BeenThere: libvir-list@redhat.com X-Mailman-Version: 2.1.12 Precedence: junk List-Id: Development discussions about the libvirt library & tools List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Sender: libvir-list-bounces@redhat.com Errors-To: libvir-list-bounces@redhat.com X-Scanned-By: MIMEDefang 2.79 on 10.5.11.13 X-Greylist: Sender IP whitelisted, not delayed by milter-greylist-4.5.16 (mx1.redhat.com [10.5.110.27]); Fri, 16 Mar 2018 18:12:33 +0000 (UTC) X-ZohoMail: RSF_0 Z_629925259 SPT_0 Content-Type: text/plain; charset="utf-8" Another usage of deprecated 'string' functions. We are just trying to match ascii letters here, so use a simple regex. And again drop the aggressive exception handling, it doesn't seem to trigger for anything in libvirt code. Signed-off-by: Cole Robinson Reviewed-by: Daniel P. Berrang=C3=A9 --- docs/apibuild.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) diff --git a/docs/apibuild.py b/docs/apibuild.py index e81980e3c..51abf8383 100755 --- a/docs/apibuild.py +++ b/docs/apibuild.py @@ -11,7 +11,6 @@ from __future__ import print_function =20 import os, sys -import string import glob import re =20 @@ -2092,23 +2091,20 @@ class docBuilder: str =3D str.replace(';', ' ') tokens =3D str.split() for token in tokens: - try: - c =3D token[0] - if string.letters.find(c) < 0: - pass - elif len(token) < 3: + c =3D token[0] + if not re.match(r"[a-zA-Z]", c): + pass + elif len(token) < 3: + pass + else: + lower =3D token.lower() + # TODO: generalize this a bit + if lower =3D=3D 'and' or lower =3D=3D 'the': pass + elif token in self.xref: + self.xref[token].append(id) else: - lower =3D string.lower(token) - # TODO: generalize this a bit - if lower =3D=3D 'and' or lower =3D=3D 'the': - pass - elif token in self.xref: - self.xref[token].append(id) - else: - self.xref[token] =3D [id] - except: - pass + self.xref[token] =3D [id] =20 def analyze(self): if not quiet: --=20 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list