https://bugs.documentfoundation.org/show_bug.cgi?id=160685

            Bug ID: 160685
           Summary: CreateScriptService("Calc") produces AttributeError:
                    'NoneType' object has no attribute
                    'createScriptProvider'
           Product: LibreOffice
           Version: 24.2.2.2 release
          Hardware: x86-64 (AMD64)
                OS: Linux (All)
            Status: UNCONFIRMED
          Severity: normal
          Priority: medium
         Component: Calc
          Assignee: [email protected]
          Reporter: [email protected]

The last line of this basic Python script 
inspired by the official doc
https://help.libreoffice.org/latest/en-US/text/sbasic/shared/03/sf_calc.html

################################################
import sys

PATH = '/usr/lib/libreoffice/program/'
if PATH not in sys.path:
    sys.path.append(PATH)

from scriptforge import CreateScriptService
doc = CreateScriptService("Calc")
################################################

produces this error:

################################################
Traceback (most recent call last):
  File "/test.py", line 8, in <module>
    doc = CreateScriptService("Calc")
          ^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/libreoffice/program/scriptforge.py", line 2992, in
CreateScriptService
    ScriptForge()
  File "/usr/lib/libreoffice/program/scriptforge.py", line 73, in __call__
    cls.instances[cls] = super(_Singleton, cls).__call__(*args, **kwargs)
                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/libreoffice/program/scriptforge.py", line 150, in __init__
    ScriptForge.scriptprovider = self.ScriptProvider(self.componentcontext)  #
...script.provider.XScriptProvider
                                 ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
  File "/usr/lib/libreoffice/program/scriptforge.py", line 199, in
ScriptProvider
    return masterscript.createScriptProvider("")
           ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'createScriptProvider'
################################################

This is my first bug report, sorry if my report is not ideal.

-- 
You are receiving this mail because:
You are the assignee for the bug.

Reply via email to