* Re: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
2026-08-22 14:41 [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso
@ 2026-08-22 15:11 ` Salvatore Bonaccorso
2026-08-31 22:57 ` Steve Dickson
` (2 subsequent siblings)
3 siblings, 0 replies; 5+ messages in thread
From: Salvatore Bonaccorso @ 2026-08-22 15:11 UTC (permalink / raw)
To: Anna Schumaker; +Cc: Steve Dickson, linux-nfs, 1144982, Trent W. Buck
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
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
2026-08-22 14:41 [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso
2026-08-22 15:11 ` Salvatore Bonaccorso
@ 2026-08-31 22:57 ` Steve Dickson
2026-08-31 22:57 ` Steve Dickson
2026-08-31 22:58 ` Steve Dickson
3 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2026-08-31 22:57 UTC (permalink / raw)
To: Salvatore Bonaccorso, Anna Schumaker; +Cc: linux-nfs, 1144982, Trent W. Buck
On 8/22/26 10:41 AM, 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>
Committed... (tag: nfs-utils-2-9-3-rc2)
steved.
> ---
> 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:
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
2026-08-22 14:41 [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso
2026-08-22 15:11 ` Salvatore Bonaccorso
2026-08-31 22:57 ` Steve Dickson
@ 2026-08-31 22:57 ` Steve Dickson
2026-08-31 22:58 ` Steve Dickson
3 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2026-08-31 22:57 UTC (permalink / raw)
To: Salvatore Bonaccorso, Anna Schumaker; +Cc: linux-nfs, 1144982, Trent W. Buck
On 8/22/26 10:41 AM, 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>
Committed... (tag: nfs-utils-2-9-3-rc2)
steved.
> ---
> 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:
^ permalink raw reply [flat|nested] 5+ messages in thread* Re: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
2026-08-22 14:41 [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso
` (2 preceding siblings ...)
2026-08-31 22:57 ` Steve Dickson
@ 2026-08-31 22:58 ` Steve Dickson
3 siblings, 0 replies; 5+ messages in thread
From: Steve Dickson @ 2026-08-31 22:58 UTC (permalink / raw)
To: Salvatore Bonaccorso, Anna Schumaker; +Cc: linux-nfs, 1144982, Trent W. Buck
On 8/22/26 10:41 AM, 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>
Committed... (tag: nfs-utils-2-9-3-rc2)
steved.
> ---
> 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:
^ permalink raw reply [flat|nested] 5+ messages in thread