Bug 159528 - officehelper.py doesn't function in the context of macOS
Summary: officehelper.py doesn't function in the context of macOS
Status: RESOLVED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: LibreOffice (show other bugs)
Version:
(earliest affected)
24.2.0.3 release
Hardware: All macOS (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:24.8.0
Keywords:
Depends on:
Blocks:
 
Reported: 2024-02-02 17:01 UTC by Alain Romedenne
Modified: 2024-03-15 08:51 UTC (History)
2 users (show)

See Also:
Crash report or crash signature:


Attachments

Note You need to log in before you can comment on or make changes to this bug.
Description Alain Romedenne 2024-02-02 17:01:27 UTC
Description:
officehelper.bootstrap() method seeks for UNO_PATH environment variable which is not defined. This leads to invoke 'soffice' command in place of fully qualified 'Applications/LibreOffice.app/Contents/MacOS/soffice' command 

Steps to Reproduce:
Run embedded Python interpreter or:
1. Install APSO extension
2. Run Python interpreter using APSO

In above Python REPL console:
3. type 'import officehelper as oh'
4. type 'oh.bootstrap()'
5. wait a few seconds

Actual Results:
bootstrap() method raises a NoConnectException:
- as this method does not detect the faulty command it spawns
- as this method fails to connect to a missing process

Expected Results:
bootstrap() connects successfully to '.../soffice' process 


Reproducible: Always


User Profile Reset: No

Additional Info:
In order to construct a fully qualified 'soffice' command bootstrap() method seeks for UNO_PATH environment variable that's missing in the context of macOS.

- LO macOS build process may include an alias for 'soffice' that is mapped to its fully qualified name    'Applications/LibreOffice.app/Contents/MacOS/soffice'
Comment 1 Rafael Lima 2024-02-02 19:56:07 UTC
I do not have a macOS machine to test it.

However I got the same error running it on Kubuntu with the PPA installation of LO 7.6. I got:

uno.com.sun.star.connection.NoConnectException

It works on Windows... a pyuno object is returned.
Comment 2 Alain Romedenne 2024-02-03 11:40:38 UTC
Detailed explanations from:
https://wiki.documentfoundation.org/Documentation/DevGuide/First_Steps#Getting_Started_2
Comment 3 Commit Notification 2024-03-02 12:00:59 UTC
Alain Romedenne committed a patch related to this issue.
It has been pushed to "master":

https://git.libreoffice.org/core/commit/d8978a8c4ffabd6b36a691fd3e2df68563808234

tdf#116156 tdf#157162 tdf#159528 Fix glitches in officehelper.py

It will be available in 24.8.0.

The patch should be included in the daily builds available at
https://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
https://wiki.documentfoundation.org/Testing_Daily_Builds

Affected users are encouraged to test the fix and report feedback.