Gentoo Websites Logo
Go to: Gentoo Home Documentation Forums Lists Bugs Planet Store Wiki Get Gentoo!
Bug 949854 - app-office/libreoffice-bin-24.8.4 python macros failed to start
Summary: app-office/libreoffice-bin-24.8.4 python macros failed to start
Status: UNCONFIRMED
Alias: None
Product: Gentoo Linux
Classification: Unclassified
Component: Current packages (show other bugs)
Hardware: All Linux
: Normal normal
Assignee: Andreas K. Hüttel
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2025-02-16 23:31 UTC by email200202
Modified: 2025-02-26 09:25 UTC (History)
3 users (show)

See Also:
Package list:
Runtime testing required: ---


Attachments
Error window (Screenshot_20250216_193932.png,35.87 KB, image/png)
2025-02-16 23:33 UTC, email200202
Details
hello_macro.py (hello_macro.py,1.19 KB, text/x-python)
2025-02-17 04:29 UTC, email200202
Details

Note You need to log in before you can comment on or make changes to this bug.
Description email200202 2025-02-16 23:31:52 UTC
Python macros which used to run on previous versions of librecalc could not be invoked after update to 24.8.4. See the attached screenshot.

Masking out this version and downgrading to 24.2.7.2, the macros started working as before.

Reproducible: Always
Comment 1 email200202 2025-02-16 23:33:24 UTC
Created attachment 919125 [details]
Error window
Comment 2 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-17 02:33:13 UTC
Can you give me steps to reproduce, assuming I've never used macros before, with some simple example? Thanks.
Comment 3 email200202 2025-02-17 04:29:13 UTC
Created attachment 919127 [details]
hello_macro.py
Comment 4 email200202 2025-02-17 04:31:01 UTC
Hi Sam, 

Attached simple python macro example


Installation Instructions:

1. Copy the Script

    $ cp hello_macro.py /usr/lib64/libreoffice/share/Scripts/python/

2. Enable Macros

    - Open LibreOffice Calc.
    - Go to Tools -> Options -> LibreOffice -> Security -> Macro Security.
    - Set security to High to allow Python macros.

3. Run the Macro

    - Open Calc.
    - Select any cell.
    - Go to Tools -> Macros -> Run Macro.
    - Navigate to Application Macros -> hello_macro.py -> hello_macro.
    - Click Run.

4. Check Output

    - The selected cell should now contain "Hello world, LibreOffice year 2025".
Comment 5 email200202 2025-02-17 08:21:24 UTC
I found that libreoffice 24.8 installation path is different from the 24.2 version and also there is a new use flag to enable 'python'.

After moving the scripts to the new path and enabling the use flag, the scripts worked.

The new path is "/opt/libreoffice24.8/share/Scripts/python/"
Comment 6 email200202 2025-02-17 09:07:13 UTC
If I can report different issue in version 24.8, the headless command line gives errors which were not in 24.2:  

$ /opt/libreoffice24.8/program/soffice --convert-to csv:"Text - txt - csv (StarCalc):44,,,,,,,,,,,6" --headless  file.ods 
Could not find platform independent libraries <prefix>
Could not find platform dependent libraries <exec_prefix>
Consider setting $PYTHONHOME to <prefix>[:<exec_prefix>]
convert file.ods as a Calc document using filter : Text - txt - csv (StarCalc):44,,,,,,,,,,,6
Writing sheet Test -> balance-Test.csv
Comment 7 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-23 00:07:41 UTC
(In reply to email200202 from comment #5)
> I found that libreoffice 24.8 installation path is different from the 24.2
> version and also there is a new use flag to enable 'python'.
> 
> After moving the scripts to the new path and enabling the use flag, the
> scripts worked.
> 
> The new path is "/opt/libreoffice24.8/share/Scripts/python/"

It's a bit of a shame but the new versioning scheme (which is in a sense great as it allows slotting) falls prey to this. Maybe can add an einfo about it though on upgrades?
Comment 8 Sam James archtester Gentoo Infrastructure gentoo-dev Security 2025-02-23 00:08:26 UTC
Many thanks for the simple testcase. Let me try reproduce the 2nd error.