Issue 128569 - Python script can't import ssl
Summary: Python script can't import ssl
Status: CLOSED NOT_AN_OOO_ISSUE
Alias: None
Product: General
Classification: Code
Component: scripting (show other issues)
Version: 4.0.0
Hardware: PC Windows, all
: P5 (lowest) Normal (vote)
Target Milestone: ---
Assignee: AOO issues mailing list
QA Contact:
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2023-05-28 10:34 UTC by psilocybe
Modified: 2023-07-19 08:15 UTC (History)
2 users (show)

See Also:
Issue Type: DEFECT
Latest Confirmation in: ---
Developer Difficulty: ---


Attachments
importSSL.py macro (1.03 KB, text/plain)
2023-06-15 23:14 UTC, psilocybe
no flags Details
No error encountered when script running (50.62 KB, image/jpeg)
2023-07-11 08:06 UTC, oooforum (fr)
no flags Details

Note You need to log in before you can comment on or make changes to this issue.
Description psilocybe 2023-05-28 10:34:32 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)
Comment 1 psilocybe 2023-05-30 09:12:43 UTC
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.
Comment 2 psilocybe 2023-06-11 09:44:24 UTC
Up...

Would anyone be kind enough to confirm or not this issue?
Comment 3 psilocybe 2023-06-15 23:14:55 UTC
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.
Comment 4 psilocybe 2023-06-16 14:37:19 UTC
More information here: https://forum.openoffice.org/fr/forum/viewtopic.php?p=373903#p373903
Comment 5 oooforum (fr) 2023-07-11 08:06:40 UTC
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
Comment 6 psilocybe 2023-07-11 11:40:41 UTC
(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...
Comment 7 psilocybe 2023-07-11 12:24:40 UTC
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...
Comment 8 oooforum (fr) 2023-07-11 14:03:24 UTC
(In reply to psilocybe from comment #7)
> For me this problem is solved...

So issue is closed too
Comment 9 psilocybe 2023-07-13 21:36:26 UTC
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...
Comment 10 oooforum (fr) 2023-07-19 08:15:19 UTC
(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