Apache OpenOffice (AOO) Bugzilla – Issue 128569
Python script can't import ssl
Last modified: 2023-07-19 08:15:19 UTC
Hi all, If you are using OpenOffice 4.x.x on Windows 7, 8 10, 11 (x32) or (x64), you cannot import ssl into a python script (or an extension) without having an import error stating that the _ssl module is not found. How to reproduce: - The case that works: On Windows (7, 8, 10 or 11) open an Command Prompt(CMD). Go to the installation folder of the OpenOffice program with the command: cd "C:\Program Files (x86)\OpenOffice 4\program" Launch the Python interpreter with the command: python In the Python interpreter you can type the following commands: - import ssl - print(ssl.OPENSSL_VERSION) It should read: OpenSSL 1.0.2u 20 Dec 2019 - The case that does not work: Install the OAuth2OOo extension: https://github.com/prrvchr/OAuth2OOo/raw/master/OAuth2OOo.oxt In OpenOffice go to: Tools -> Options -> Internet -> OAuth2 protocol In Logger setting choose the OAuth2Logger log and enable logging. Save by exiting this window with Ok and restarting OpenOffice. Go back to: Tools -> Options -> Internet -> OAuth2 protocol Click on the view log button and in this window on the system info button Close and reopen the view log: you have the import error message on the module _ssl (you must install the jdbcDriverOOo extension and Java 11 if you want to have a full localized error message)
I forgot to mention that everything works fine with OpenOffice 4.x.x and Ubuntu and therefore this problem seems to be more related to the OpenOffice package delivered for Windows.
Up... Would anyone be kind enough to confirm or not this issue?
Created attachment 87189 [details] importSSL.py macro Put the macro importSSL.py in the right folder with the command: copy importSSL.py %UserProfile%\AppData\Roaming\OpenOffice\4\user\Scripts\python Run macro through menus: Tools -> Macros -> Run macros... -> My Macros -> importSSL -> importSSL -> Run Normally there must be an error on import ssl module.
More information here: https://forum.openoffice.org/fr/forum/viewtopic.php?p=373903#p373903
Created attachment 87197 [details] No error encountered when script running Remember that this issue tracker is not dedicated for OXT debug. Testing with your step-by-step in comment #3 No error occurs with AOO 4.1.14 and Windows 10 x64 Pro
(In reply to oooforum (fr) from comment #5) > Remember that this issue tracker is not dedicated for OXT debug. This has nothing to do with my extension since I manage to reproduce just with this python macro!!! I'm surprised, Bidouille, that you bothered to try...
Anyway OAuth2OOo 1.x has just migrated to Python 3.8 minimum. No more support for OpenOffice and LibreOffice 6.x on Windows. For me this problem is solved...
(In reply to psilocybe from comment #7) > For me this problem is solved... So issue is closed too
You are free to do what you are responsible for. But given the macro that I took the trouble to write and which confirms this issue, I don't think this decision makes much sense: > it is not because you close an issue that it is resolved ... It only confirms that I made the right decision to migrate to Python 3.8 minimum...
(In reply to psilocybe from comment #9) > But given the macro that I took the trouble to write and which confirms this > issue, I don't think this decision makes much sense Read my comment 5 and see the attached screenshot