Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > linux.debian.kernel > #93825 > unrolled thread

Bug#1144982: python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block

Started by"Trent W. Buck" <trentbuck@gmail.com>
First post2026-08-21 09:20 +0200
Last post2026-09-23 09:10 +0200
Articles 3 — 3 participants

Back to article view | Back to linux.debian.kernel


Contents

  Bug#1144982: python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block "Trent W. Buck" <trentbuck@gmail.com> - 2026-08-21 09:20 +0200
    Bug#1144982: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block Salvatore Bonaccorso <carnil@debian.org> - 2026-08-22 16:50 +0200
    Bug#1144982: marked as done (python3.14 says /sbin/rpcctl:47:  SyntaxWarning: 'return' in a 'finally' block) "Debian Bug Tracking System" <owner@bugs.debian.org> - 2026-09-23 09:10 +0200

#93825 — Bug#1144982: python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block

From"Trent W. Buck" <trentbuck@gmail.com>
Date2026-08-21 09:20 +0200
SubjectBug#1144982: python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block
Message-ID<NurHH-cfRg-7@gated-at.bofh.it>
Package: nfs-common
Version: 1:2.8.3-1
Severity: minor
File: /usr/sbin/rpcctl

Debian 14 / python 3.14 now complains about rpcctl.

    root@hera:/# rpcctl --help
    /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block
      return res
    [...]

    root@hera:/# sed -n -e '38,48p' /sbin/rpcctl

    def read_info_file(path):
        """Read an xprt or xprt switch information file."""
        res = collections.defaultdict(int)
        try:
            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

Based on https://github.com/iritkatriel/finally#:~:text=contains%20only%20a%20return
I think the correct fix is this edit:

        -finally:
        -    return res
        +return res

See also:

https://docs.python.org/3/whatsnew/3.14.html#pep-765-control-flow-in-finally-blocks
https://peps.python.org/pep-0765/

[toc] | [next] | [standalone]


#93852 — Bug#1144982: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block

FromSalvatore Bonaccorso <carnil@debian.org>
Date2026-08-22 16:50 +0200
SubjectBug#1144982: [PATCH] rpcctl: SyntaxWarning: 'return' in a 'finally' block
Message-ID<NuVcK-cwNM-5@gated-at.bofh.it>
In reply to#93825
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

[toc] | [prev] | [next] | [standalone]


#94179 — Bug#1144982: marked as done (python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block)

From"Debian Bug Tracking System" <owner@bugs.debian.org>
Date2026-09-23 09:10 +0200
SubjectBug#1144982: marked as done (python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block)
Message-ID<NGph7-1hLW-9@gated-at.bofh.it>
In reply to#93825

[Multipart message — attachments visible in raw view] — view raw

Your message dated Wed, 23 Sep 2026 07:05:06 +0000
with message-id <E1x9H2Q-0000000FYyx-2nPL@fasolo.debian.org>
and subject line Bug#1144982: fixed in nfs-utils 1:3.1.1-1
has caused the Debian Bug report #1144982,
regarding python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block
to be marked as done.

This means that you claim that the problem has been dealt with.
If this is not the case it is now your responsibility to reopen the
Bug report if necessary, and/or fix the problem forthwith.

(NB: If you are a system administrator and have no idea what this
message is talking about, this may indicate a serious mail system
misconfiguration somewhere. Please contact owner@bugs.debian.org
immediately.)


-- 
1144982: https://bugs.debian.org/cgi-bin/bugreport.cgi?bug=1144982
Debian Bug Tracking System
Contact owner@bugs.debian.org with problems

[toc] | [prev] | [standalone]


Back to top | Article view | linux.debian.kernel


csiph-web