Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Unoconv version check is incorrect, fails on older LibreOffice #50

Closed
TuxmAL opened this issue Apr 23, 2012 · 7 comments
Closed

Unoconv version check is incorrect, fails on older LibreOffice #50

TuxmAL opened this issue Apr 23, 2012 · 7 comments
Assignees
Labels
Milestone

Comments

@TuxmAL
Copy link

TuxmAL commented Apr 23, 2012

unoconv opens libreoffice (version 3.3.2, from the info dialo box) main window instead of executing conversion. After closing the window it says thet was "Unable to connect or start own listener. Aborting." This is what I had on my console:

# unoconv -vvvvvvvvvvvv -f pdf t.odt
Verbosity set to level 11
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Office base location: /usr/lib64/libreoffice
Office binary location: /usr/lib64/libreoffice/basis-link/program
Existing listener not found.
Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
LibreOffice listener successfully started. (pid=31457)
Process /usr/lib64/libreoffice/program/soffice.bin (pid=31457) exited with 0.
Error: Unable to connect or start own listener. Aborting.

Further investigations (I'm a programmer but I didn't know well Python) adding some debug line:

@@ -654,10 +654,13 @@
             info(3, "Launching our own listener using %s." % office.binary)
             try:
                 product = self.svcmgr.createInstance("com.sun.star.configuration.ConfigurationProvider").createInstanceWithArguments("com.sun.star.configuration.ConfigurationAccess", UnoProps(nodepath="/org.openoffice.Setup/Product"))
-                if product.ooName != "LibreOffice" or product.ooSetupVersion <= 3.3:
+                info(2, 'Found version %s v%s' % (product.ooName, product.ooSetupVersion))
+                if product.ooName != "LibreOffice" or product.ooSetupVersion <= "3.3":
                     ooproc = subprocess.Popen([office.binary, "-headless", "-invisible", "-nocrashreport", "-nodefault", "-nofirststartwizard", "-nologo", "-norestore", "-accept=%s" % op.connection], env=os.environ)
+                    info(2, 'Single dash')
                 else:
                     ooproc = subprocess.Popen([office.binary, "--headless", "--invisible", "--nocrashreport", "--nodefault", "--nofirststartwizard", "--nologo", "--norestore", "--accept=%s" % op.connection], env=os.environ)
+                    info(2, 'Double dash')
                 info(2, '%s listener successfully started. (pid=%s)' % (product.ooName, ooproc.pid))

                 ### Try connection to it for op.timeout seconds (flakky OpenOffice)

And I obtained a succesfull run:

$ unoconv -vvvvvvvvvvvv -f pdf ~/t.odt
Verbosity set to level 11
Connection type: socket,host=localhost,port=2002;urp;StarOffice.ComponentContext
Office base location: /usr/lib64/libreoffice
Office binary location: /usr/lib64/libreoffice/basis-link/program
Existing listener not found.
Launching our own listener using /usr/lib64/libreoffice/program/soffice.bin.
Found version LibreOffice v3.3
Single dash
LibreOffice listener successfully started. (pid=11180)
Input file: /home/aliccardo/t.odt
Selected output format: Portable Document Format [.pdf]
Selected office filter: writer_pdf_Export
Used doctype: document
Output file: /home/aliccardo/t.pdf
Terminating LibreOffice instance.
Waiting for LibreOffice instance to exit.

Strangely the LibreOffice version is 3.3 instead of 3.3.2
hope this will help!

@dagwieers
Copy link
Member

We know there is a problem with older OpenOffice versions because the version comparison check is wrong. I will rewrite this bug to track it, it is an important one that needs fixing :-/

@TuxmAL
Copy link
Author

TuxmAL commented Apr 24, 2012

Thanks Dag!
I incorrectly stated OpenOffice in the title (now amended) But my trouble was with LibreOffice v3.3.2

@ghost ghost assigned dagwieers Apr 26, 2012
@dagwieers
Copy link
Member

I think I fixed this in the latest commit. Can you please verify the latest master branch and tell me if this works ? :)

The fix was quite simple (as usual).

@TuxmAL
Copy link
Author

TuxmAL commented Apr 30, 2012

Dag, I can't verifiy this fix at home and I'm on vacation until May 2, so you must wait until I'll return to work. Sorry for the delay!

@dagwieers
Copy link
Member

On Mon, 30 Apr 2012, Antonio Liccardo wrote:

Dag, I can't verifiy this fix at home and I'm on vacation until May 2,
so you must wait until I'll return to work. Sorry for the delay!

No problem, have a nice holiday !

Kind regards,

-- dag wieers, dag@wieers.com, http://dag.wieers.com/
-- dagit linux solutions, info@dagit.net, http://dagit.net/

[Any errors in spelling, tact or fact are transmission errors]

@TuxmAL
Copy link
Author

TuxmAL commented May 2, 2012

Dag, I've verified your fix and I can confirm it works!
Many thanks!

@dagwieers
Copy link
Member

You're welcome. Thanks for reporting !

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants