The second error message is when specifying the exact path in the script like 
this:
lo_proc = 
subprocess.Popen(shlex.split("/snap/libreoffice/current/lib/libreoffice/program/soffice
 --accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo 
--nodefault"))

-- 
You received this bug notification because you are a member of Desktop
Packages, which is subscribed to libreoffice in Ubuntu.
https://bugs.launchpad.net/bugs/1806514

Title:
  Cannot use PyUno connector with Libreoffice snap

Status in libreoffice package in Ubuntu:
  New

Bug description:
  It's not possible to use pyoo, which uses the Uno connector to
  Libreoffice, on a machine where the Libreoffice Snap is installed. The
  pyoo/Uno connector works fine with the libreoffice Apt packages.

  To reproduce run this script:
  #!/usr/bin/env python3
  import pyoo
  import subprocess
  import time
  import shlex

  # PyOO needs a running Libreoffice process to do its work
  lo_proc = subprocess.Popen(shlex.split("soffice 
--accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo 
--nodefault"))
  time.sleep(3) # give Libreoffice time to actually start before trying to 
connect to it
  lo_instance = pyoo.Desktop('localhost', 2002)
  lo_instance.create_spreadsheet()

  Expected results (seen with the Libreoffice DEB-packages from Ubuntu):
  A new Calc window opens up showing a spreadsheet

  Actual results:
  $ ./test.py 
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1833, in 
_get_remote_context
      return resolver.resolve(url)
  uno.NoConnectException: Connector : couldn't connect to socket (Success)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "./test.py", line 10, in <module>
      lo_instance = pyoo.Desktop('localhost', 2002)
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1853, in 
__init__
      self.remote_context = _get_remote_context(resolver, url)
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1835, in 
_get_remote_context
      raise IOError(resolver, url)
  OSError: [Errno pyuno object 
(com.sun.star.uno.XInterface)0x1ff9450{implementationName=com.sun.star.comp.bridge.UnoUrlResolver,
 supportedServices={com.sun.star.bridge.UnoUrlResolver}, 
supportedInterfaces={com.sun.star.lang.XServiceInfo,com.sun.star.bridge.XUnoUrlResolver,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}}]
 uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext

  
  Actual results if you specify the path to the soffice binary:
  lo_proc = subprocess.Popen(shlex.split("soffice 
--accept=\"socket,host=localhost,port=2002;urp;\" --norestore --nologo 
--nodefault"))

  $ ./test.py 
  /snap/libreoffice/90/lib/libreoffice/program/soffice.bin: error while loading 
shared libraries: libicuuc.so.55: cannot open shared object file: No such file 
or directory
  Traceback (most recent call last):
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1833, in 
_get_remote_context
      return resolver.resolve(url)
  uno.NoConnectException: Connector : couldn't connect to socket (Success)

  During handling of the above exception, another exception occurred:

  Traceback (most recent call last):
    File "./test.py", line 10, in <module>
      lo_instance = pyoo.Desktop('localhost', 2002)
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1853, in 
__init__
      self.remote_context = _get_remote_context(resolver, url)
    File "/usr/local/lib/python3.6/dist-packages/pyoo.py", line 1835, in 
_get_remote_context
      raise IOError(resolver, url)
  OSError: [Errno pyuno object 
(com.sun.star.uno.XInterface)0x1b11450{implementationName=com.sun.star.comp.bridge.UnoUrlResolver,
 supportedServices={com.sun.star.bridge.UnoUrlResolver}, 
supportedInterfaces={com.sun.star.lang.XServiceInfo,com.sun.star.bridge.XUnoUrlResolver,com.sun.star.lang.XTypeProvider,com.sun.star.uno.XWeak}}]
 uno:socket,host=localhost,port=2002;urp;StarOffice.ComponentContext

To manage notifications about this bug go to:
https://bugs.launchpad.net/ubuntu/+source/libreoffice/+bug/1806514/+subscriptions

-- 
Mailing list: https://launchpad.net/~desktop-packages
Post to     : [email protected]
Unsubscribe : https://launchpad.net/~desktop-packages
More help   : https://help.launchpad.net/ListHelp

Reply via email to