From patchwork Fri Mar 16 18:05:11 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 131937 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp640995edb; Fri, 16 Mar 2018 11:10:28 -0700 (PDT) X-Google-Smtp-Source: AG47ELvefY+i61MiQH/AtHgGiN83+N5iv6GHG8f6FYXtGmQNHA+St77pyHX60g3WlNKakf6UBsdD X-Received: by 2002:a9d:61c2:: with SMTP id h2-v6mr1724965otk.236.1521223828484; Fri, 16 Mar 2018 11:10:28 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521223828; cv=none; d=google.com; s=arc-20160816; b=lvfpMZ7Vtwjit5xFeGDgnjGEkmBjNDR/twZNLvDrjDSL5jtigxjDp0w+y86UqYy1Gq A9Bo3jST6u2QFUdBf2+uOvxG5XPMOjlVQ+dKBESvQUALLGK0u4qoK/7j/qX2sRlUG6Wq kVvym5WUUKG5rXLZAPKl3qXp56KviNXs9AcUxywk7cwXmxTut+Yh5g/3v2TC0k1Abzra Pl8jZ/0puXnIkFf32W1hDNjWoC4SQCzTDab2SqiadVI5EhkcEamTRTuRVvis3ZF60Ofz rQr1hhZwSMjjhrb+U3o8j8fUkUyMspwT8Zfua06x+KKnmzAg8VsJ6bG+CtYzaOK7Z30x Q8Zw== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=a2X0X+EEKMKp13b8JgLLzQ8azCGIG6RjklVj9C4ZnVw=; b=UsE7Dvfaw5Cv9zupYxfhksrk3W4qva5wS95hkim/W466OKnEh6E4Uib7DUBgZc8eYH q2C0YgcB8ebDFpTtddU1f+qoSDNVc6WkET68eIw2Zxx6WoBzr8QPdKIQ2bKye5ijFPzG KykIQaQKtGRVum8P46igr4X4P88zShrvtMCMpIekIq+hk1OKGRxSwv7kyal9DJKGTMPk Ch4SbCSFaWes19HxPrhu2Ma+UUd5HFpsghuRlMJpbM/AhM926RdgZJWqkjOpR5Jz6HFc AcC1kXzclDYfULlaXPrv+BWz34l5VAkAoxyIe3NkLucloHmXysmWxXtsb3UuVM2lNCrM AuXQ== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id v91si2326986otb.410.2018.03.16.11.10.23 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 11:10:28 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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) Delivered-To: libvirt-list@redhat.com 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 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) 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 --- docs/apibuild.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) -- 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Daniel P. Berrangé 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" % (module, data)) if 'Description' in dict.info: desc = dict.info['Description'] From patchwork Fri Mar 16 18:05:12 2018 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: Cole Robinson X-Patchwork-Id: 131939 Delivered-To: patch@linaro.org Received: by 10.80.152.129 with SMTP id j1csp643026edb; Fri, 16 Mar 2018 11:12:34 -0700 (PDT) X-Google-Smtp-Source: AG47ELs87YXqnLcJcKg+rAF6GYriuI/nfMlZO1V5A1wrbB2WghBMTcsHlz36Evi34GwJGv+0Lo3P X-Received: by 10.202.193.214 with SMTP id r205mr1784230oif.139.1521223954078; Fri, 16 Mar 2018 11:12:34 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1521223954; cv=none; d=google.com; s=arc-20160816; b=CdIrTi9CKwq+4+KpzTIna/DdHx0wSkJrz8uIOvUX2Nr20+z+y7G+IvihexZEAvkVRx lEnyNYL0pKRuDdlRqXPUY/DUbRKZ/Aj3Ei78OdxwBN53aGAqx7CWs3BECQIIvbUY678K q2jjbmKmmIXS1ejGQyKuUnd0gH/eLjl+cnotXjrm531b5JARqxsMVd0/+FuEB26QGMVs L+8/NZCSvtVOZB6FLdLRsaMDHpkOv0pAC3gXI2jcuSQCUmBTkr9EsMy33xkARkxWLBrh bybT/D8M3HAhvPg4EnfRQ0nzwH3lV0DR10kjw2Vr+/vPF7KzSQS4Ksn8U6HxQuqnDtMF YbUA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=errors-to:sender:content-transfer-encoding:mime-version :list-subscribe:list-help:list-post:list-archive:list-unsubscribe :list-id:precedence:subject:cc:references:in-reply-to:references :in-reply-to:message-id:date:to:from:delivered-to :arc-authentication-results; bh=fQgax75nktGRS9VWxFisPTKx4D4afJTp2tDdy05L1H0=; b=IWE+Y6EGSgAndh2dNln1DGAYeY8bCUzw0FXjmywRD9chkCKJpjWF17X1r12KlbaaiO u+vG7lHOGaccuz4rs3zy3mdLTqL//AD6t/Yj6B3ZuyKMskhW9o/Zdg+jxXDbq3mGmyYm J0SgRdnJkEMconl8kWJ+GBpL4dFfL0rh5i9pEGLV36EGRPy+mnxlBmYoMLoY3TznlKjP q0g4SugVyIq2KG9tRhCQA0PEjH0H7kr5/KYwz2AOg7nZ9GSQ+u4XElWy2cV1iaaHmiTU UcXAs+gJwGghqgq+Ni28bh22fW3xMnf5UWCZGpVtOGYe36hqzhWw0Pb0HI14kFI+QXpD ZLbw== ARC-Authentication-Results: i=1; mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com Return-Path: Received: from mx1.redhat.com (mx1.redhat.com. [209.132.183.28]) by mx.google.com with ESMTPS id s187si2157276oia.325.2018.03.16.11.12.33 (version=TLS1_2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 16 Mar 2018 11:12:34 -0700 (PDT) Received-SPF: pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) client-ip=209.132.183.28; Authentication-Results: mx.google.com; spf=pass (google.com: domain of libvir-list-bounces@redhat.com designates 209.132.183.28 as permitted sender) smtp.mailfrom=libvir-list-bounces@redhat.com; dmarc=pass (p=NONE sp=NONE dis=NONE) header.from=redhat.com 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) Delivered-To: libvirt-list@redhat.com 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 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) 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 --- docs/apibuild.py | 28 ++++++++++++---------------- 1 file changed, 12 insertions(+), 16 deletions(-) -- 2.14.3 -- libvir-list mailing list libvir-list@redhat.com https://www.redhat.com/mailman/listinfo/libvir-list Reviewed-by: Daniel P. Berrangé 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 import os, sys -import string import glob import re @@ -2092,23 +2091,20 @@ class docBuilder: str = str.replace(';', ' ') tokens = str.split() for token in tokens: - try: - c = token[0] - if string.letters.find(c) < 0: - pass - elif len(token) < 3: + c = token[0] + if not re.match(r"[a-zA-Z]", c): + pass + elif len(token) < 3: + pass + else: + lower = token.lower() + # TODO: generalize this a bit + if lower == 'and' or lower == 'the': pass + elif token in self.xref: + self.xref[token].append(id) else: - lower = string.lower(token) - # TODO: generalize this a bit - if lower == 'and' or lower == 'the': - pass - elif token in self.xref: - self.xref[token].append(id) - else: - self.xref[token] = [id] - except: - pass + self.xref[token] = [id] def analyze(self): if not quiet: