Bug 143832 - Can not generate pycache (.pyc) files on Windows as non-admin accounts
Summary: Can not generate pycache (.pyc) files on Windows as non-admin accounts
Alias: None
Product: LibreOffice
Classification: Unclassified
Component: Installation (show other bugs)
(earliest affected) release
Hardware: All Windows (All)
: medium minor
Assignee: Not Assigned
Whiteboard: QA:needsComment
Depends on:
Blocks: Macro-Python
  Show dependency treegraph
Reported: 2021-08-12 09:00 UTC by Ming Hua
Modified: 2021-08-27 04:06 UTC (History)
0 users

See Also:
Crash report or crash signature:
Regression By:


Note You need to log in before you can comment on or make changes to this bug.
Description Ming Hua 2021-08-12 09:00:14 UTC
It seems that the way current Windows MSI installer is set up, if LibreOffice is installed by an admin account to the default place (C:\Program Files\LibreOffice), a non-admin account can use the application perfectly fine, including Python scripting features, but the bundled Python can not generate the .pyc pycache files because the non-admin account doesn't have write permission for C:\Program Files\LibreOffice\program directory.

Presumably this will cause LibreOffice compiling to bytecode each time Python is used, and affect performance for heavy Python-scripting users.

Steps to reproduce:
1. Install LibreOffice on Windows using the MSI installer, either from an account with admin privileges, or from an ordinary account and provide password for admin when asked.  Use the default installation directory "C:\Program Files\LibreOffice", but anywhere else that ordinary users don't have write access should also be OK.

2. Do NOT start LibreOffice from the admin account.

3. Start LibreOffice from the ordinary non-admin account, run some Python sample macros that came with the installation.  Optionally one can also try some Python commands and macros from command line using the bundled Python.

4. Observe that no matter how Python is used, the directory supposed to store pycache files "C:\Program Files\LibreOffice\program\__pycache__" and "C:\Program Files\LibreOffice\program\python-core-<version>\lib\__pycache__" are not created, and the .pyc files are not generated.

Expected result:
Generate pycache files for non-admin account, somewhere in user profile, maybe?  Or alternatively the installation process can generate them as admin account?

Additional Information:
This is hard to test with parallel installation, so I only get this for my main 7.0.6 installation:
Version: (x64)
Build ID: 144abb84a525d8e30c9dbbefa69cbbf2d8d4ae3b
CPU threads: 2; OS: Windows 10.0 Build 19043; UI render: default; VCL: win
Locale: zh-CN (zh_CN); UI: en-US
Calc: threaded
...but I don't think this has changed for 7.2 or master.