Package: libreoffice-common
Version: 4:25.2.3-2+deb13u6
Severity: minor
File: /usr/lib/libreoffice/share/Scripts/python/ScriptForgeHelper.py

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/

Reply via email to