unoconv using deprecated LibreOffice switches

Bug #889735 reported by John Pye
16
This bug affects 3 people
Affects Status Importance Assigned to Milestone
unoconv (Ubuntu)
Fix Released
Undecided
Unassigned

Bug Description

I have a script that processes a bunch of LibreOffice files to extract information. The script runs 'unoconv', but as of current LibreOffice on Ubuntu 11.10, unoconv is outputtting a bunch of warnings to stdout every time it runs.

Seems as though some command line arguments have been changed but the corresponding unoconv stuff hasn't been updated.

Warning: -headless is deprecated. Use --headless instead.
Warning: -invisible is deprecated. Use --invisible instead.
Warning: -nodefault is deprecated. Use --nodefault instead.
Warning: -nofirststartwizard is deprecated. Use --nofirststartwizard instead.
Warning: -nologo is deprecated. Use --nologo instead.
Warning: -norestore is deprecated. Use --norestore instead.
Warning: -accept=socket,host=localhost,port=2002;urp;StarOffice.ComponentContext is deprecated. Use --accept=socket,host=localhost,port=2002;urp;StarOffice.Com

Revision history for this message
penalvch (penalvch) wrote :

John Pye, thank you for reporting this and helping make Ubuntu better. Please execute the following command, as it will automatically gather debugging information, in a terminal:
apport-collect 889735
When reporting bugs in the future please use apport by using 'ubuntu-bug' and the name of the package affected. You can learn more about this functionality at https://wiki.ubuntu.com/ReportingBugs.

Could you please attach the script that when run, demonstrates this problem?

affects: libreoffice (Ubuntu) → unoconv (Ubuntu)
summary: - unoconv (LibreOffice) outputs warnings
+ unoconv using deprecated LibreOffice switches
Changed in unoconv (Ubuntu):
status: New → Incomplete
Revision history for this message
John Pye (jdpipe) wrote :

What additional information are you lacking that makes this bug report incomplete? Sorry, I reported this as a libreoffice bug as I assumed that the unoconv package was built out of the same source package as libreoffice.

Revision history for this message
John Pye (jdpipe) wrote :

This was on Ubuntu 11.10 32 bit. From the output below, I can see that my assumption was obviously wrong.

john@novo:~$ unoconv --version
unoconv 0.4
Written by Dag Wieers <email address hidden>
Homepage at http://dag.wieers.com/home-made/unoconv/

platform posix/linux2
python 2.7.2+ (default, Oct 4 2011, 20:03:08)
[GCC 4.6.1]

build revision $Rev$
john@novo:~$

Revision history for this message
John Pye (jdpipe) wrote :

Further followup: I found that if I already have LibreOffice running, I don't get these errors. Seems that unoconv is invoking a headless version of libreoffice, then closing it if no longer needed. When I have open documents, it doesn't close (or open) a new LO hence no error.

My script is just a Python script that invokes 'unoconv' over and over with different files, outputting each as text to stdout.

Changed in unoconv (Ubuntu):
status: Incomplete → New
Revision history for this message
dag (dag-wieers) wrote : Re: [Bug 889735] Re: unoconv using deprecated LibreOffice switches

On Mon, 14 Nov 2011, John Pye wrote:

> Further followup: I found that if I already have LibreOffice running, I
> don't get these errors. Seems that unoconv is invoking a headless
> version of libreoffice, then closing it if no longer needed. When I have
> open documents, it doesn't close (or open) a new LO hence no error.
>
> My script is just a Python script that invokes 'unoconv' over and over
> with different files, outputting each as text to stdout.

Hi,

I am the author of unoconv.

LibreOffice changed the options (from short options to long options)
recently and while completely innocent (because they provided backward
compatibility) it is at least annoying to see it complain about this. I
can not surpress this because it might as well be outputting an important
warning or fatal error to the user.

The real problem is that there is no good/simple solution. Either I
support only the latest LibreOffice versions, or you get this error.

There is one possible work-around, since unoconv already has the UNO
bindings loaded, there might be a way to retrieve the exact version from
UNO (without needing LibreOffice/OpenOffice). I need to investigate if
that is at all possible.

Pull-requests are appreciated at:

     http://github.com/dagwieers/unoconv

;-)
--
-- dag wieers, <email address hidden>, http://dag.wieers.com/
-- dagit linux solutions, <email address hidden>, http://dagit.net/

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

Revision history for this message
Launchpad Janitor (janitor) wrote :

Status changed to 'Confirmed' because the bug affects multiple users.

Changed in unoconv (Ubuntu):
status: New → Confirmed
Revision history for this message
A. Bram Neijt (bneijt) wrote :

I'd have to take some time to fork the code, but why not use something like:

import os
def isLibreOffice(binaryPath):
    return "libre" in os.path.realpath(binaryPath).lower()

print "is libre", isLibreOffice("/usr/bin/soffice")

I have not tested this on Windows, but it should help fix the errors on my system at least ;) Post a comment if you want me to take the time to convert this into a patch on github.

Revision history for this message
dag (dag-wieers) wrote :

On Wed, 11 Jan 2012, A. Bram Neijt wrote:

> I'd have to take some time to fork the code, but why not use something
> like:
>
> import os
> def isLibreOffice(binaryPath):
> return "libre" in os.path.realpath(binaryPath).lower()
>
> print "is libre", isLibreOffice("/usr/bin/soffice")
>
> I have not tested this on Windows, but it should help fix the errors on
> my system at least ;) Post a comment if you want me to take the time to
> convert this into a patch on github.

This does not help, because older LibreOffice versions did not complain
either, and do not accept long options, so you will break those.

If you want to do this, you have to query the UNO interface to get the
name/version and then based on both provide the correct options. And while
you're there, you might as well improve the options based on the
capabilities of the version.

Again, is it worth the trouble ?

--
-- dag wieers, <email address hidden>, http://dag.wieers.com/
-- dagit linux solutions, <email address hidden>, http://dagit.net/

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

Revision history for this message
dag (dag-wieers) wrote :

I fixed it last night in the latest version on Github. Can you please test this version on your Ubuntu system ?

I would like to release this as soon as possible, but need some more widespread testing as I live in a Linux mono-culture :-)

Changed in unoconv (Ubuntu):
status: Confirmed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.