Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]
Groups > linux.debian.bugs.dist > #1305771
| From | "Trent W. Buck" <trentbuck@gmail.com> |
|---|---|
| Newsgroups | linux.debian.bugs.dist, linux.debian.kernel |
| Subject | Bug#1144982: python3.14 says /sbin/rpcctl:47: SyntaxWarning: 'return' in a 'finally' block |
| Date | 2026-08-21 09:20 +0200 |
| Message-ID | <NurHH-cfRg-7@gated-at.bofh.it> (permalink) |
| Organization | linux.* mail to news gateway |
Cross-posted to 2 groups.
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/
Back to linux.debian.bugs.dist | Previous | Next — Next in thread | Find similar | Unroll thread
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
csiph-web