Issue 125677

Summary: _socket.pyd missing export function "init_socket"
Product: App Dev Reporter: kenjiuno <h8mastre>
Component: apiAssignee: AOO issues mailing list <issues>
Status: UNCONFIRMED --- QA Contact:
Severity: Normal    
Priority: P3 CC: oooforum
Version: 4.1.1   
Target Milestone: ---   
Hardware: PC   
OS: Windows 7   
Issue Type: DEFECT Latest Confirmation in: ---
Developer Difficulty: ---

Description kenjiuno 2014-09-26 04:46:32 UTC
unoconv (a doc converter) fails on OpenOffice 4.1.1 (Windows Server 2012)



Here is stderr output from unoconv:
----------
unoconv: Cannot find a suitable pyuno library and python binary combination in C:\Program Files (x86)\OpenOffice 4

ERROR: DLL load failed: 指定されたプロシージャが見つかりません。



unoconv: Cannot find a suitable pyuno library and python binary combination in C:\Program Files (x86)\OpenOffice 4

ERROR: DLL load failed: 指定されたプロシージャが見つかりません。



unoconv: Cannot find a suitable office installation on your system.

ERROR: Please locate your office installation and send your feedback to:

       http://github.com/dagwieers/unoconv/issues
----------



The error occurs on following fragment:
----------
import uno, unohelper
----------



So, I have tried it on OpenOffice's attached python "C:\Program Files (x86)\OpenOffice 4\program\python.exe":
----------
Python 2.7 (r27:82525, Jul  4 2010, 09:01:59) [MSC v.1500 32 bit (Intel)] on win
32
Type "help", "copyright", "credits" or "license" for more information.
>>> import uno
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "uno.py", line 36, in <module>
    import socket # since on Windows sal3.dll no longer calls WSAStartup
  File "C:\Program Files (x86)\OpenOffice 4\program\python-core-2.7.6\lib\socket
.py", line 47, in <module>
    import _socket
ImportError: DLL load failed: 指定されたプロシージャが見つかりません。
----------



And, I have checked _socket.pyd by DependencyWalker: "C:\Program Files (x86)\OpenOffice 4\program\python-core-2.7.6\lib\_socket.pyd"

It has no export function.



Also I have checked my computer's _socket.pyd: C:\Python27\DLLs\_socket.pyd

Is has 2 export functions: init_socket and init_sockobject.



Thus python's "import" fails due to lack of export functions?



And I have replaced OpenOffice's _socket.pyd with my computer's _socket.pyd.

It workd!



So, please fix OpenOffice's _socket.pyd.

pyuno may not work with it.
Comment 1 oooforum (fr) 2014-09-26 08:18:15 UTC
Python 2.x is obsolete. So, the solution is to update to Python 3.
Please report your vote to Issue 123975
Comment 2 kenjiuno 2014-09-26 09:15:05 UTC
(In reply to oooforum from comment #1)
> Python 2.x is obsolete. So, the solution is to update to Python 3.
> Please report your vote to Issue 123975

Okay I'm just surprised to hear that you are trying to replace your Python 2.x.
There is no problem about incoming Python 3k. unoconv already works on Python 3k with latest LibreOffice.
So I may help the promotion of current state someday...