Created attachment 42291 [details] extension that can't register the Python script on Windows The Python scripts list is empty and the extension installation (in the attachment) ends with error on Windows XP and Windows 7 due to the Python script can't be registered. (The extension is for Writer and resides in Tools/Add-ons menu, it can test Java, JavaScript, Python and Basic scripts, it is extracted from here: http://wiki.services.openoffice.org/wiki/Extensions_Packager#A_sophisticated_extension)
CC
I can reproduce the problem on WinXP and LOrc4, any python scripts are not shown in the script organizer of Python. It seems this problem is based on implementation loader for Python. The script provider for python depends on it. I tried to execute the following basic code to make new instance of css.loader.Python: Sub Main CreateUnoService("com.sun.star.loader.Python") End Sub I got the following error: Type: com.sun.star.uno.RuntimeException Message: python-loader:<type 'exceptions.ImportError'>: No module named pythonloader. traceback follows no traceback available.
[LibO 3.3.0 RC4 on WinXP] The same issue with the following Python extensions/scripts: (1) Linguist 1.5 (.oxt) <http://extensions.services.openoffice.org/en/project/Linguist> (2) TradutorOOoText 1.0.0 (.oxt) <http://extensions.services.openoffice.org/en/project/TradutorOOoText> (3) OO.o Live Word Count (wc.py) <https://bitbucket.org/yawaramin/oo.o-live-word-count/src/940baeb4fcc2/> The extensions/scripts don't work, and I get the attached error messages. (Works fine with OOo 3.3.0 RC10.)
Created attachment 42357 [details] Error messages (Linguist / TradutorOOoText / OO.o Live Word Count) Error messages (Linguist / TradutorOOoText / OO.o Live Word Count)
Bug reproduced on Windows 7 also. Imho, this bug is a *blocker*.
confirmed with xp with rc4 for me too -> tor
Bug reproduced on Windows Vista too. It can be quick fixed: Simply copy pythonloader.uno.dll from OOo3.1 to LibreOffice directory Basis/Program.
Yep, a nice workaround. :) With <pythonloader.uno.dll> from OOo 3.3 RC10--copied to LibO 3.3 RC4--my issues were fixed (s. comment #3), and the Python scripts list is perfect.
When I try to install the extension in the initial comment, I get an error dialog titled "Extension Manager" that says "Failed to register package for vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/.... I don't understand.
(In reply to comment #9) > When I try to install the extension in the initial comment, I get an error > dialog titled "Extension Manager" that says "Failed to register package for > vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/.... I don't > understand. This is a subsequent error of the LibO python loader not working. Comment #2 is a more direct way of reproducing this. However, I can confirm the workaround in comment #7 works. The extension can then be installed successfully.
BTW, no need to copy the pythonloader.uno.dll from some old OOo version, just copy if from Basis\program in the LibreOffice installation. It might even work to *move* it, investigating. Comment #2 indeed looks much more useful for debugging this.
Ah, I wrote the last comment before actually checking; even if I copy pythonloader.uno.dll from Basis\program to program, I can't install the ExtExample-1.0.1.oxt, I get the same error message.
Suggested fix: commit 8dfc7cf7a1967d1313826651dbcdf1c46a03779f Author: Tor Lillqvist <tlillqvist@novell.com> Date: Tue Jan 25 16:24:07 2011 +0200 Manipulate also the C runtime's environment Fixes fdo#33355. diff --git a/sal/osl/w32/process.cxx b/sal/osl/w32/process.cxx index 796f4c4..1749b8e 100644 --- a/sal/osl/w32/process.cxx +++ b/sal/osl/w32/process.cxx @@ -28,6 +28,7 @@ #define UNICODE #include "system.h" +#include <string.h> #ifdef _MSC_VER #pragma warning(push,1) /* disable warnings within system headers */ #endif @@ -419,7 +420,15 @@ oslProcessError SAL_CALL osl_setEnvironment(rtl_uString *ustrVar, rtl_uString *u LPCWSTR lpName = reinterpret_cast<LPCWSTR>(ustrVar->buffer); LPCWSTR lpValue = reinterpret_cast<LPCWSTR>(ustrValue->buffer); if (SetEnvironmentVariableW(lpName, lpValue)) + { + wchar_t *buffer = new wchar_t[wcslen(lpName) + 1 + wcslen(lpValue) + 1]; + wcscpy(buffer, lpName); + wcscat(buffer, L"="); + wcscat(buffer, lpValue); + _wputenv(buffer); + delete[] buffer; return osl_Process_E_None; + } return osl_Process_E_Unknown; } @@ -429,7 +438,14 @@ oslProcessError SAL_CALL osl_clearEnvironment(rtl_uString *ustrVar) //process's environment. LPCWSTR lpName = reinterpret_cast<LPCWSTR>(ustrVar->buffer); if (SetEnvironmentVariableW(lpName, NULL)) + { + wchar_t *buffer = new wchar_t[wcslen(lpName) + 1 + 1]; + wcscpy(buffer, lpName); + wcscat(buffer, L"="); + _wputenv(buffer); + delete[] buffer; return osl_Process_E_None; + } return osl_Process_E_Unknown; }
Approved by Fridrich, committed to master and libreoffice-3-3. Will thus be in 3.3.1.
I confirm with numbertext's extension (http://numbertext.org/), and workaround in comment#7 don't work...
*** Bug 32329 has been marked as a duplicate of this bug. ***
Bug 32329 - [MAILMERGE] E-Mail server connection fails Verified with "LibreOffice 3.3.1 RC1 - WIN7 Home Premium (64bit) German UI [OOO330m19 (build 7 / tag 3.3.1.1)]", works fine now.
I confirm I can use Python extensions and see python scripts with LO 3.3.1 RC 2 on WinXP : LibreOffice 3.3.1 OOO330m19 (Build:8) tag libreoffice-3.3.1.2
There's another different MacOSX bug (bug #34699) which has a similar looking effect, but is triggered with python 2.3 as apparently used on that platform.
That issue occurs again with libo_3.4.0beta2_win_x86_install_multi.exe LibreOffice 3.4.0 Beta 2 [daily - current - 20-Apr-2011 13:46] [on WinXP] (1) ExtExample-1.0.1.oxt (attached extension id=422921) "Failed to register package for vnd.sun.star.expand:$UNO_SHARED_PACKAGES_CACHE/uno_packages/..." [see attached screenshot "error_ExtExample"] (2) Tools > Macros > Run > LibreOffice Macros > HelloWorld Missing "HelloWorldPython" [see attached screenshots "tools_macros_run_libo340b2.png" and "tools_macros_run_libo332.png"]
Created attachment 45908 [details] Screenshot "error_ExtExample"
Created attachment 45909 [details] Comparison 1: Screenshots "tools_macros_run_libo340b2.png"
Created attachment 45910 [details] Comparison 2: Screenshot "tools_macros_run_libo332.png" (LibO 3.3.2)
I confirm. Broken again in 3.4 Beta 2...
Setting version to 3.4 beta1 as we don't have beta2 yet available there.
I am not sure it makes sense to reopen this old bug; the root cause might well be a very different one, even if the symptom is the same.
<http://wiki.documentfoundation.org/BugReport_Details#Version>
Maybe relevent, or not... It's also a bug in OOo DEV300m103. (As far as I can see: still no bug report.)
...and therefore also broken in OOo 3.4 Beta [OOo-dev 3.4.0 OOO340m0 Build 9583].
caolanm->dtardon: can you check with petr if the vanilla packages are built with --with-ext-scripting-python or whatever its called or tweak it to be default yes.
dtardon->caolanm: supposing comment 28 is right, it looks like the problem is somewhere else. but i'll ask anyway.
@ALL: I just checked OOo-dev 340 (build 9583) on Mac OSX 10.6.7. The only python script that actually shows up in the Macros management dialog is the HelloWorld.py. There are entries (i.e. folder representations) for the other scripts, but they appear not to be present. This HelloWorld.py script also runs, so the python loader is functional here. However, this looks like the same issue as one I posted previously for Mac, bug 34669 and which Christian and Caolan sorted out - certainly, the fix was entered for 3.3.2 final per the commits below. http://cgit.freedesktop.org/libreoffice/libs-core/commit/?id=bef88b2ebf98faacedd911944ba20fe963498396 and http://cgit.freedesktop.org/libreoffice/libs-core/commit/?h=libreoffice-3-3&id=5c2ed6488e7619cb2fd2a1e996c46a81760822a9 With LibO 3.4 b4, if I look at the Tools-Macros-Organise Macros menu entry, I only have one entry, i.e. LibreOffice Basic, and the Basic macros are effectively the only ones that are displayed/visible. None of the others are available, i.e. no python, no JS, no Beanshell. However, if I inpsect the Mac app packet, I can see the scripts all present in /Contents/share/Scripts. So there is the possibility that we have the same problem as was resolved with thos previous commits for bug 34669. Perhaps they were overwritten by the OOo code merge ? HTH Alex
I meant LibO b3 and not b4 of course. Alex
Perhaps we should close this and reopen 34669 instead ? Alex
it looks like it was caused by missing config option, in which case it should be okay in 3.4.0 beta4 (due tomorrow)
Sorry, no change (for me) with LibO 3.4.O Beta 4. [The same issue as Comment 20]
LibO_3.4.0beta5_Win_x86_install_multi.exe [pre-release] LibreOffice 3.4.0 DEV300m103 (Build:5) Tested again the examples in Comment 20: (1) ExtExample-1.0.1.oxt could install/enable the extension. The scripts work well. (2) Tools > Macros > Run > LibreOffice Macros > HelloWorld "HelloWorldPython" is available and works. Tools > Macros > Organize Macros is complete again. Also: (3) Python script 'wc.py', added to my user profile, is now available and works. Please confirm and set to FIXED VERIFIED again.
Seems to be working in beta5 according to the comment #37 => mark as FIXED
Not working in beta 5 on Mac OSX. See bug 37015. Alex
Maybe I should add: That bug (33355) is about *Python* scripts. Python (and Java) scripts work well with Beta 5 on WinXP 32b. Beanshell scripts get an error message, but that's Bug 36915 (as I understand: fixed for RC 1). [See also the attached screenshot]
Created attachment 46778 [details] Screenshot: Hello World...
I think this is fixed, if not, open a new one, this bug is now officially a mess