Received: by 2002:a05:6358:11c7:b0:104:8066:f915 with SMTP id i7csp4570334rwl; Tue, 28 Mar 2023 08:31:26 -0700 (PDT) X-Google-Smtp-Source: AKy350a6GNUvt0CQiGr82OyjVVuVc+lbPR+omJRC1i8l8RAUE6VxhxqtpuSETt55KGjJKi1haE2X X-Received: by 2002:aa7:9629:0:b0:628:1274:4d67 with SMTP id r9-20020aa79629000000b0062812744d67mr16351755pfg.24.1680017486449; Tue, 28 Mar 2023 08:31:26 -0700 (PDT) ARC-Seal: i=1; a=rsa-sha256; t=1680017486; cv=none; d=google.com; s=arc-20160816; b=jxxl7PXj6+uMXJW6BSwt8FxZ4nkKAQZQmTpUdVH1Uxvc35TeKpZvddzTzLa6WIr0vC wYWyScZVEJqDJtSlwfIHznGwaSGd8nHNRvoyquvtDA7w7rbhw3D7grzeNCU+he9V4AAj mLGIynT9+S2/vv1X6a30BU4Ku2V7ZlStAfZUnBlDcVwdWmGblHKzfWZrklqhDe/0goGT trr0qfmzTaZ2I12B+EU1eOO2tRT2cdfn4llTwRmLNRYjYIIeCYWmwNZAOmh2TOQLfOeK hL+qDYsnOy6p+2+mGzX8/WVJMPevw0YqQsO3F2xZ/raMWhSAFnE7Crc4abzErWeVshQ0 4UDA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-language:thread-index :content-transfer-encoding:mime-version:message-id:date:subject :in-reply-to:references:cc:to:from:dkim-signature; bh=VtSGJnO6dCW+SfAmxp/CTF2W/DkyXXrOsV+4HKetbxM=; b=UWasMwADYga139LsD5P0acB7UynVZ6bd7HBpy5NXOBSWs26a9yuVys//qb42tr84yj G3R2GiV/n5y5s2M2DUjguZRxHc4NQvKn4x2NG1AD3D+5V53Iea7T9Nvcm/ZySfUylncN WrB8VPtjjxCcooD0tGHG5Tt7xE1OUGzV8FWmSBy3Cz2lAP8Cp4chWONmhTNpm+2ItACi 6e8vwptLVixjq2t5QqHXg47Df017s+Hbiuu9piHT6ikDmk3H8cOby0wvJRsrj7zXeY4Q ecCiQyfIYZkhASpnPLfdyn4tkVrqPlU9hgDa6c/8KnO4aT4WFB8k5M7++i/sJDUoMoP/ C09g== ARC-Authentication-Results: i=1; mx.google.com; dkim=fail header.i=@earthlink.net header.s=dk12062016 header.b=U5X8ukYd; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mindspring.com Return-Path: Received: from out1.vger.email (out1.vger.email. [2620:137:e000::1:20]) by mx.google.com with ESMTP id u63-20020a638542000000b00513234112acsi10564456pgd.888.2023.03.28.08.31.11; Tue, 28 Mar 2023 08:31:26 -0700 (PDT) Received-SPF: pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) client-ip=2620:137:e000::1:20; Authentication-Results: mx.google.com; dkim=fail header.i=@earthlink.net header.s=dk12062016 header.b=U5X8ukYd; spf=pass (google.com: domain of linux-nfs-owner@vger.kernel.org designates 2620:137:e000::1:20 as permitted sender) smtp.mailfrom=linux-nfs-owner@vger.kernel.org; dmarc=fail (p=NONE sp=NONE dis=NONE) header.from=mindspring.com Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S233463AbjC1P1e (ORCPT + 99 others); Tue, 28 Mar 2023 11:27:34 -0400 Received: from lindbergh.monkeyblade.net ([23.128.96.19]:50052 "EHLO lindbergh.monkeyblade.net" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S233922AbjC1P1R (ORCPT ); Tue, 28 Mar 2023 11:27:17 -0400 Received: from mta-102a.earthlink-vadesecure.net (mta-102b.earthlink-vadesecure.net [51.81.61.67]) by lindbergh.monkeyblade.net (Postfix) with ESMTPS id 7C15FF76F for ; Tue, 28 Mar 2023 08:25:58 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; bh=VtSGJnO6dCW+SfAmxp/CTF2W/DkyXXrOsV+4HK etbxM=; c=relaxed/relaxed; d=earthlink.net; h=from:reply-to:subject: date:to:cc:resent-date:resent-from:resent-to:resent-cc:in-reply-to: references:list-id:list-help:list-unsubscribe:list-subscribe:list-post: list-owner:list-archive; q=dns/txt; s=dk12062016; t=1680017128; x=1680621928; b=U5X8ukYd82lcNxR4889cqunE7wKnUN7fxiR8ve0Gi/hTfqXhS9BR2kS kk6cwYbN8mTW+3s5o+1z9A0gT1893S021QiEbHk1GJWQ24Fiu/nLIyiwC3Mmzm43c9ZOjY1 6eitBhSuqE3zFXTXcoMVSx1T9ILT4awBNtcax0tO1wG6SdeUnOaZCyGV4JWdjroq3BwypW5 NjcGxYyVe/r5D1lUYTn2Nb9Zd7ecqhPxLMbjfhN1AIJHiGSOBFG44lsK6zDhlJ1se5geK1D HQXDPNPAj9AX8WFK/G9KV/mV119udce7P+N76MFfKRLdYjwEEtek9ZLDdGGssuYHtOUt3j9 MBA== Received: from FRANKSTHINKPAD ([174.174.49.201]) by smtp.earthlink-vadesecure.net ESMTP vsel1nmtao02p with ngmta id d1e7961c-17509ead44736c66; Tue, 28 Mar 2023 15:25:28 +0000 From: "Frank Filz" To: "'NeilBrown'" , "'Bruce Fields'" , "'Jeff Layton'" Cc: "'Linux NFS Mailing List'" References: <167996453785.8106.14290228013263156210@noble.neil.brown.name> In-Reply-To: <167996453785.8106.14290228013263156210@noble.neil.brown.name> Subject: RE: [PATCH pynfs] rpc.py: Don't try to subscript an exception. Date: Tue, 28 Mar 2023 08:25:27 -0700 Message-ID: <011501d96189$86f2e760$94d8b620$@mindspring.com> MIME-Version: 1.0 Content-Type: text/plain; charset="UTF-8" Content-Transfer-Encoding: quoted-printable X-Mailer: Microsoft Outlook 15.0 Thread-Index: AQGzsPtoPu+eDxk3wRxvo/A2s6C0fK9bsOMg Content-Language: en-us Authentication-Results: earthlink-vadesecure.net; auth=pass smtp.auth=ffilzlnx@mindspring.com smtp.mailfrom=ffilzlnx@mindspring.com; X-Spam-Status: No, score=2.0 required=5.0 tests=DKIM_SIGNED,DKIM_VALID, HK_RANDOM_ENVFROM,HK_RANDOM_FROM,RCVD_IN_DNSWL_NONE,RCVD_IN_MSPIKE_H2, SPF_HELO_NONE,SPF_PASS autolearn=no autolearn_force=no version=3.4.6 X-Spam-Level: * X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on lindbergh.monkeyblade.net Precedence: bulk List-ID: X-Mailing-List: linux-nfs@vger.kernel.org Thanks. I have this patch in my repo and keep not getting around to = submitting it. Frank > -----Original Message----- > From: NeilBrown [mailto:neilb@suse.de] > Sent: Monday, March 27, 2023 5:49 PM > To: Bruce Fields ; Jeff Layton = > Cc: Linux NFS Mailing List > Subject: [PATCH pynfs] rpc.py: Don't try to subscript an exception. >=20 >=20 > As far as I can tell python3 has never supported subscripting of = exceptions. > So don't try to... >=20 > Signed-off-by: NeilBrown > --- > nfs4.0/lib/rpc/rpc.py | 2 +- > rpc/rpc.py | 2 +- > 2 files changed, 2 insertions(+), 2 deletions(-) >=20 > diff --git a/nfs4.0/lib/rpc/rpc.py b/nfs4.0/lib/rpc/rpc.py index > 24a7fc72eff0..585db3551f73 100644 > --- a/nfs4.0/lib/rpc/rpc.py > +++ b/nfs4.0/lib/rpc/rpc.py > @@ -227,7 +227,7 @@ class RPCClient(object): > sock.bind(('', port)) > return > except socket.error as why: > - if why[0] =3D=3D errno.EADDRINUSE: > + if why.errno =3D=3D errno.EADDRINUSE: > port +=3D 1 > else: > print("Could not use low port") diff --git = a/rpc/rpc.py b/rpc/rpc.py > index 1fe285aa2b5b..814de4e08bc9 100644 > --- a/rpc/rpc.py > +++ b/rpc/rpc.py > @@ -846,7 +846,7 @@ class ConnectionHandler(object): > s.bind(('', using)) > return > except socket.error as why: > - if why[0] =3D=3D errno.EADDRINUSE: > + if why.errno =3D=3D errno.EADDRINUSE: > using +=3D 1 > if port < 1024 <=3D using: > # If we ask for a secure port, make sure we = don't > -- > 2.40.0