https://bugs.documentfoundation.org/show_bug.cgi?id=151455
Bug ID: 151455
Summary: SQLError Event fails with Python
Product: LibreOffice
Version: 7.4.1.2 release
Hardware: All
OS: All
Status: UNCONFIRMED
Severity: normal
Priority: medium
Component: Base
Assignee: [email protected]
Reporter: [email protected]
Description:
The attached database contains a HSQL table with a unique index on a
(case-insensitive) text field and an integer primary key.
One form triggers a Basic routine on index violation. The macro analyses the
error object and pops up a user-defined error message.
The other form tries to do the same with Python code. However, the Python
bridge complains about the error object when the following line is about to be
executed:
s1 = er.Message
where er is ev.Source.Reason and ev.Source is an c.s.s.sdb.SQLErrorEvent
Steps to Reproduce:
1. Open odb document and TBL_Basic form.
2. Add/edit some record with duplicate name or ID.
3. You get a user-defined error message.
4. Do the same with form TBL_Python
Actual Results:
With the Python macro you get a runtime error because Python can't swallow
ev.Source.Reason
A Scripting Framework error occurred while running the Python script
vnd.sun.star.script:SQL_Error.py$SQLError?language=Python&location=document.
Message: <class 'ImportError'>: No module named 'apso_utils' (or
'apso_utils.msgbox' is unknown)
File "/opt/libreoffice7.2/program/pythonscript.py", line 1057, in getScript
mod = self.provCtx.getModuleByUrl( fileUri )
File "/opt/libreoffice7.2/program/pythonscript.py", line 494, in
getModuleByUrl
exec(code, entry.module.__dict__)
File "vnd.sun.star.tdoc:/55308760/Scripts/python/SQL_Error.py", line 3, in
<module>
File "/opt/libreoffice7.2/program/uno.py", line 423, in _uno_import
raise uno_import_exc
File "/opt/libreoffice7.2/program/uno.py", line 346, in _uno_import
return _builtin_import(name, *optargs, **kwargs)
Expected Results:
Should work with Python as well
Reproducible: Always
User Profile Reset: No
Additional Info:
none
--
You are receiving this mail because:
You are the assignee for the bug.