[Top][All Lists]

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[bug#39647] [PATCH] gnu: Add unoconv.

From: Tobias Geerinckx-Rice
Subject: [bug#39647] [PATCH] gnu: Add unoconv.
Date: Fri, 21 Feb 2020 02:24:32 +0100


Jakub Kądziołka 写道:
unoconv: format [jw4yj39s84jb4fkvqpsqwq-unoconv-0.9.0/bin/.unoconv-real] is not known to unoconv.

I feel like this might be an issue with the packaging. Does it work for

I don't see how this could be related to packaging… And it works just fine on my laptop:

me@lapdog $ guix env --{pure,ad-hoc} unoconv coreutils¹ grep¹ \
           -- unoconv test-file.odt

me@lapdog $ # a pretty .pdf file is born!

But fine, I'll try it on another machine:

me@server $ guix env --{pure,ad-hoc} unoconv coreutils grep \
           -- unoconv test-file.odt

—and here's where I must stop to thank you for reporting the BESTEST BUG of 2020. Seriously. This made my day. I laughed! I cried!

Let's take another look at your error:

% unoconv ~/Downloads/ -o scheme-macro-phd.pdf
unoconv: format [jw4yj39s84jb4fkvqpsqwq-unoconv-0.9.0/bin/.unoconv-real] is not known to unoconv.

So… it's obvious that unoconv is erroneously parsing argv0 as target format. Indeed, on both my machines, using the explicit ‘-f <format>’

guix@env $ unoconv -f pdf test-file.odt

returns success and a .pdf file.

So is the long /gnu/store/… name overflowing a buffer? Perhaps the wrapper script is to blame? Maybe I should look at the co—

       ### If no format was specified, probe it or provide it
       if not self.format:
           ### Check if the command is in the form odt2pdf
           l = sys.argv[0].split('2')
           if len(l) == 2:
               self.format = l[1]

Oh.  Oh my.

I'd like to bet that the character before ‘jw4yj39s84jb4fkvqpsqwq-unoconv-0.9.0/’ in your store name is a ‘2’. Because that's what it is on my server. By sheer chance, the store name on my lapdog has TWO 2s, and so unoconv chugs blissfully onward.

I'm not sure what kind of fix upstream will accept for this. At least a length limit, surely. In the mean time it's trivial to just substitute* this out, since we won't ship any foo2bar symlinks our this package anyway.

+         (add-after 'unpack 'patch-find_offices
I think that the convention is to replace underscores by dashes in names
like these.

Then I gladly thwart it.

Wouldn't it be simpler to do

    return [Office(...)]



My reasoning at the time was literally: ‘well… I should closely emulate upstream style [they use ret = … and append()] because I've never written a Python in my life, and they have, so they obviously know what they're doing.’

Needless to say, I'm currently reconsidering that opinion.



[1]: ‘coreutils’ & ‘grep’ are undeclared dependencies of ‘soffice’ — will fix, but not relevant here.

Attachment: signature.asc
Description: PGP signature

reply via email to

[Prev in Thread] Current Thread [Next in Thread]