From: Salvatore Bonaccorso <carnil@debian.org>
To: Anna Schumaker <anna.schumaker@oracle.com>
Cc: Steve Dickson <steved@redhat.com>,
linux-nfs@vger.kernel.org, 1144982@bugs.debian.org,
"Trent W. Buck" <trentbuck@gmail.com>
Subject: Re: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
Date: Sat, 22 Aug 2026 17:11:39 +0200 [thread overview]
Message-ID: <aom8K-fFQq9BLZga@eldamar.lan> (raw)
In-Reply-To: <20260822144142.682662-1-carnil@debian.org>
Hi,
On Sat, Aug 22, 2026 at 04:41:42PM +0200, Salvatore Bonaccorso wrote:
> Trent W. Buck reported that when using rpcctl with Python 3.14
> version, a SyntaxWarning warning is issued on the use of return in the
> finally block in the read_info_file function.
>
> Replace the finally clause with an except BaseException, and dedent the
> return by one level up.
>
> Reported-by: "Trent W. Buck" <trentbuck@gmail.com>
> Link: https://docs.python.org/3/whatsnew/3.14.html#pep-765-control-flow-in-finally-blocks
> Closes: https://bugs.debian.org/1144982
> Signed-off-by: Salvatore Bonaccorso <carnil@debian.org>
> ---
> tools/rpcctl/rpcctl.py | 5 +++--
> 1 file changed, 3 insertions(+), 2 deletions(-)
>
> diff --git a/tools/rpcctl/rpcctl.py b/tools/rpcctl/rpcctl.py
> index 29ae7d26f50e..42e238ca1c52 100755
> --- a/tools/rpcctl/rpcctl.py
> +++ b/tools/rpcctl/rpcctl.py
> @@ -43,8 +43,9 @@ def read_info_file(path):
> with open(path) as info:
> lines = [line.split("=", 1) for line in info if "=" in line]
> res.update({key: int(val.strip()) for (key, val) in lines})
> - finally:
> - return res
> + except BaseException:
> + pass
> + return res
>
>
> class Xprt:
> --
> 2.55.0
Including Anna's oracle.com address.
Regards,
Salvatore
next prev parent reply other threads:[~2026-08-22 15:11 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-08-22 14:41 [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso
2026-08-22 15:11 ` Salvatore Bonaccorso [this message]
2026-08-31 22:57 ` Steve Dickson
2026-08-31 22:57 ` Steve Dickson
2026-08-31 22:58 ` Steve Dickson
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=aom8K-fFQq9BLZga@eldamar.lan \
--to=carnil@debian.org \
--cc=1144982@bugs.debian.org \
--cc=anna.schumaker@oracle.com \
--cc=linux-nfs@vger.kernel.org \
--cc=steved@redhat.com \
--cc=trentbuck@gmail.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox