Bug Hunting Session
Bug 60670 - Error trying to run the "HelloWorld" python macro
Summary: Error trying to run the "HelloWorld" python macro
Status: VERIFIED FIXED
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: sdk (show other bugs)
Version:
(earliest affected)
4.0.0.3 release
Hardware: Other Linux (All)
: medium normal
Assignee: Not Assigned
URL:
Whiteboard: target:4.1.0 target:4.0.1
Keywords:
Depends on:
Blocks:
 
Reported: 2013-02-11 14:51 UTC by Joao Pinto
Modified: 2013-02-19 14:28 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 Joao Pinto 2013-02-11 14:51:58 UTC
I have tried to run the python sample from:
Tools -> Macros -> Run Macros -> LibreOffice Macros -> HelloWorld -> HelloWorldPython.

It fails with the following error:
com.sun.star.uno.RuntimeExceptionError during invoking function HelloWorldPython in module file:///opt/libreoffice4.0/share/Scripts/python/HelloWorld.py (<class 'AttributeError'>: Text
  /opt/libreoffice4.0/share/Scripts/python/HelloWorld.py:26 in function HelloWorldPython() [text = model.Text]
  /opt/libreoffice4.0/program/pythonscript.py:830 in function invoke() [ret = self.func( *args )]
)
Comment 1 Julien Nabet 2013-02-16 23:28:14 UTC
On pc Debian x86-64 with master sources updated today, I reproduced this problem.

Xisco: one for you?
Comment 2 Not Assigned 2013-02-17 14:22:45 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "master":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=270967f340670189e42939d9432e28e8259feefc

fdo#60670: Create a new document in case there's none



The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 3 Not Assigned 2013-02-17 14:34:29 UTC
Xisco Fauli committed a patch related to this issue.
It has been pushed to "libreoffice-4-0":

http://cgit.freedesktop.org/libreoffice/core/commit/?id=70b6d7510d6910e046342114a79321ae8654764a&h=libreoffice-4-0

fdo#60670: Create a new document in case there's none


It will be available in LibreOffice 4.0.1.

The patch should be included in the daily builds available at
http://dev-builds.libreoffice.org/daily/ in the next 24-48 hours. More
information about daily builds can be found at:
http://wiki.documentfoundation.org/Testing_Daily_Builds
Affected users are encouraged to test the fix and report feedback.
Comment 4 Julien Nabet 2013-02-17 16:59:36 UTC
Xisco: Verified on master, good and very quick work!
Comment 5 Julien Nabet 2013-02-17 17:41:00 UTC
Joao: I made other tests. In fact, it works if you run macros from Writer. With the Xisco's fix, Python version works in any case.
Comment 6 Joao Pinto 2013-02-19 14:28:19 UTC
I have tried the latest daily and it fixed the issue for me.
Thanks for the quick fix.