On 18/04/13 10:30, Alexander Thurgood wrote:
pyuno MRI extension, which installs on all versions of LO from 3.3.4 to
3.6.5, but which fails to install on LO4.0.2.2 and LibreOfficeDev master
build, with the following error message :
(com.sun.star.uno.RuntimeException) { { Message = "<class
'SyntaxError'>: invalid syntax (MRI.py, line 21), traceback
follows\X000a
/Applications/LibreOfficeDev.app/Contents/program/pythonloader.py:102 in
function getModuleFromUrl() [codeobject = compile( src,
encfile(filename), \"exec\" )]\X000a
/Applications/LibreOfficeDev.app/Contents/program/pythonloader.py:149 in
function writeRegistryInfo() [mod = self.getModuleFromUrl( locationUrl
)]\X000a\X000a", Context = (com.sun.star.uno.XInterface) @0 } }
the problem is in MRI.py which is part of the extension.
"invalid syntax" often means using "print" as a statement, not a
function, or a whitespace inconsistency (tabs vs. spaces) which was
(fortunately) promoted to a syntax error in Python 3.
Is there anything that has changed between 3.6.x and 4.x that would
cause python extensions to fail to be loaded on OSX ?
yes :) we ship Python 3 in LO 4, and Python 2 in LO 3.x.
the extension needs to be ported to Python 3.
you can point the author to http://python3porting.com/ which is very
useful... if you read carefully you can even figure out how to make
things run on both Python 2 and 3 (all Python code shipped with LO
should hopefully be able to do that).
Context
Privacy Policy |
Impressum (Legal Info) |
Copyright information: Unless otherwise specified, all text and images
on this website are licensed under the
Creative Commons Attribution-Share Alike 3.0 License.
This does not include the source code of LibreOffice, which is
licensed under the Mozilla Public License (
MPLv2).
"LibreOffice" and "The Document Foundation" are
registered trademarks of their corresponding registered owners or are
in actual use as trademarks in one or more countries. Their respective
logos and icons are also subject to international copyright laws. Use
thereof is explained in our
trademark policy.