Python macros stored in user profile can't be run.
Steps to Reproduce:
1. Copy sample python script file "HelloWorld.py" from directory share of LO instalation to directory Script/python/ on user profile.
2. Open a new text document.
3. Try to run copied python macro ("HelloWorldPyton") from user location.
An error message appears:
pyuno._createUnoStructHelper: member 'Context' of struct type 'com.sun.star.uno.Exception' not given a value.
Inserted text "Hello World (in Python)" in document.
User Profile Reset: Yes
Tested in windows 7
Id. de compilación: 9b0d9b32d5dcda91d2f1a96dc04c645c450872bf
Subprocs. CPU: 2; SO: Windows 6.1; Repres. IU: predet.;
Configuración regional: es-ES (es_ES); Calc: group
No problem for me on Windows or Linux. Tried 6.0.4 and master.
Directory name should be Scripts/python and not Script/python. Then the scripts appear in My Macros.
I can confirm with Version: 220.127.116.11.alpha0+ (x64)
Build ID: 7e8dbbb02f25278d5afc51ae4a397831f5b21239
CPU threads: 1; OS: Windows 6.1; UI render: default;
TinderBox: Win-x86_64@42, Branch:master, Time: 2018-07-15_02:52:05
@raal, any chance you could try this with previous versions of LibreOffice ?
If case of directory name is not exactly "Scripts/python" (S in uppercase and rest in lowercase) then the python scripts are displayed correctly (files and functions) but don't run and appears the indicated error message.
In my working environment (Windows 7 with PCs conected to domain) the user profile is stored in D: drive so user python scripts are stored in
Tested with local user and profile stored in C: drive the issue is not present.
Please provide us with the output of the following commands in the Python shell:
Running the Python interactive console:
I am currently working at home. I can't provide the requested information from my corporate environment.
When I can resume work in my office, I will post the information.
Test done in my working environment (now windows 10) with recent development version 18.104.22.168.alpha0+ (x86)
Version: 22.214.171.124.alpha0+ (x86)
Build ID: 8ed11b7289533bd609fbcb2adfb7b2982ef6fe22
CPU threads: 4; OS: Windows 10.0 Build 17763; UI render: Skia/Raster; VCL: win
Locale: es-ES (es_ES); UI: en-US
In this versión if case of directory name is not exactly "Scripts/python" then the python scripts are displayed correctly (files and functions) but the run button is disabled.
The results of the python shell are:
Python 3.7.7 (heads/master-dirty:8ed11b728953, Jun 28 2020, 02:29:02) [MSC v.1925 32 bit (Intel)] on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import sys
['', 'D:\\LO7\\program', 'D:\\LO7\\program\\python-core-3.7.7\\lib', 'D:\\LO7\\program\\python-core-3.7.7\\lib\\site-packages', 'D:\\LO7\\program\\python37.zip', 'D:\\LO7\\program\\python-core-3.7.7\\DLLs', 'D:\\LO7\\program\\python-core-3.7.7\\bin', 'D:\\LO7\\program\\python-core-3.7.7']
<UserProfile>/Scripts/python should be appended to Python sys.path in this context