#1144984 python3.14 says /usr/lib/libreoffice/share/Scripts/python/ScriptForgeHelper.py:257: SyntaxWarning: 'return' in a 'finally' block

#1144984#5
Date:
2026-08-21 07:26:48 UTC
From:
To:
Debian 14 / python 3.14 now complains about ScriptForgeHelper.py.

    /usr/lib/libreoffice/share/Scripts/python/ScriptForgeHelper.py:257: SyntaxWarning: 'return' in a 'finally' block
      return None

It is this code:

    def _SF_Session__OpenURLInBrowser(url: str):    # Used by SF_Session.OpenURLInBrowser() Basic method
        """
        Display url using the default browser
        """
        try:
            webbrowser.open(url, new = 2)
        finally:
            return None

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

         try:
             webbrowser.open(url, new = 2)
        -finally:
        -    return None
        +return None

A minimum recipe to reproduce this error is:

    mmdebstrap forky /dev/null --quiet --include=libreoffice-common,python3 --customize-hook='chroot $1 python3 -m compileall /usr/lib/libreoffice/'

See also:

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

#1144984#14
Date:
2026-08-29 11:16:04 UTC
From:
To:
Hello,

Bug #1144984 in libreoffice reported by you has been fixed in the
Git repository and is awaiting an upload. You can see the commit
message below and you can check the diff of the fix at:

https://salsa.debian.org/libreoffice-team/libreoffice/libreoffice/-/commit/3bcc4dddbbfb184cca93cda9707c12b005f4ee59

(this message was generated automatically)
-- 
Greetings

https://bugs.debian.org/1144984