Bug 170564 - import error message from scriptforge is confusing
Summary: import error message from scriptforge is confusing
Status: UNCONFIRMED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: BASIC (show other bugs)
Version:
(earliest affected)
25.8.4.2 release
Hardware: All Windows (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard:
Keywords:
Depends on:
Blocks:
 
Reported: 2026-02-02 03:17 UTC by tripod312
Modified: 2026-02-02 03:24 UTC (History)
0 users

See Also:
Crash report or crash signature:


Attachments
error message (29.59 KB, image/png)
2026-02-02 03:21 UTC, tripod312
Details
calc ods (25.78 KB, application/vnd.oasis.opendocument.spreadsheet)
2026-02-02 03:23 UTC, tripod312
Details
python macro (393 bytes, text/x-python)
2026-02-02 03:24 UTC, tripod312
Details

Note You need to log in before you can comment on or make changes to this bug.
Description tripod312 2026-02-02 03:17:16 UTC
Description:
I wrote macro in calc file,wrote python scrpit in macro directory.  
I executed the script add got error.  
error message from scriptforge is "NOSCRIPTERROR".
But the script exists.  
Actual error is that the script imports library which is not exists.

Steps to Reproduce:
1.create ods file and put macro bellow

Sub Main
	GlobalScope.BasicLibraries.loadLibrary("ScriptForge")
	session = CreateScriptService("Session")
	sRange=session.ExecutePythonScript(session.SCRIPTISPERSONAL, "util.py$str_format", "{}{}:{}{}","A",1,"B",10) 
	print(sRange)
End Sub

2.create util.py
C:\Users\_USER_\AppData\Roaming\LibreOffice\4\user\scripts\python\util.py

import not_present  #error

def str_format(fmt,*params):
    s = fmt.format(*params)
    return s

3.run macro

Actual Results:
error message from scriptforge is bellow

Error NOSCRIPTERROR x
A Library: ScriptForge
Service: Session
Method: ExecutePythonScript
Arguments: [Scope], Script, argO[, arg1]
A serious error has been detected in your code on argument : « Script ».
|
The requested Python script could not be located in the given libraries and
modules.
« Scope » = user
« Script » = util.py$strformat
THE EXECUTION IS CANCELLED.
Do you want to receive more information about the ‘ExecutePythonScript"
method ?
dom | DZD,


Expected Results:
error message from scriptforge is "IMPORTERROR".


Reproducible: Always


User Profile Reset: No

Additional Info:
Version: 25.8.4.2 (X86_64)
Build ID: 290daaa01b999472f0c7a3890eb6a550fd74c6df
CPU threads: 12; OS: Windows 11 X86_64 (build 26200); UI render: Skia/Raster; VCL: win
Locale: ja-JP (ja_JP); UI: ja-JP
Calc: threaded
Comment 1 tripod312 2026-02-02 03:21:11 UTC
Created attachment 205303 [details]
error message
Comment 2 tripod312 2026-02-02 03:23:08 UTC
Created attachment 205304 [details]
calc ods
Comment 3 tripod312 2026-02-02 03:24:06 UTC
Created attachment 205305 [details]
python macro