benbalter / word-to-markdown

A ruby gem to liberate content from Microsoft Word documents

Home Page:https://word2md.com

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Error when LibreOffice is open

bspeice opened this issue · comments

When any LibreOffice program is open (tested Linux Mint with both Calc and Word) this fails with an error like the following:

/var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/document.rb:91:in `read': No such file or directory - /tmp/d20150618-31341-8olz7h/some_document.html (Errno::ENOENT)
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/document.rb:91:in `raw_html'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/document.rb:58:in `normalized_html'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/document.rb:20:in `tree'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/converter.rb:78:in `semanticize_font_styles!'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown/converter.rb:18:in `convert!'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/lib/word-to-markdown.rb:31:in `initialize'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/bin/w2m:14:in `new'
    from /var/lib/gems/1.9.1/gems/word-to-markdown-1.1.3/bin/w2m:14:in `<top (required)>'
    from /usr/local/bin/w2m:23:in `load'
    from /usr/local/bin/w2m:23:in `<main>'

Can confirm this also happens on OS X 10.10.4 with LibreOffice Version: 5.0.0.5

I had to close the terminal after closing LibreOffice in order to get w2m to function normally.

I saw commit 8601370 does a check. This is much appreciated.

Yes, it's a limitation of libreoffice, but #55 should provide a descriptive error at least. I'll get a new release out that includes that fix.

Thank you for the quick reply! The loud, descriptive error is hella helpful.

Looks like issue is still reproducing, without descriptive error message:

/var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown/document.rb:92:in `raw_html': Failed to convert /home/me/Downloads/foo.docx (WordToMarkdown::Document::ConverstionError)
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown/document.rb:59:in `normalized_html'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown/document.rb:21:in `tree'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown/converter.rb:78:in `semanticize_font_styles!'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown/converter.rb:18:in `convert!'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/lib/word-to-markdown.rb:45:in `initialize'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/bin/w2m:14:in `new'
from /var/lib/gems/2.3.0/gems/word-to-markdown-1.1.7/bin/w2m:14:in `<top (required)>'
from /usr/local/bin/w2m:23:in `load'
from /usr/local/bin/w2m:23:in `<main>'

@benbalter Forgot to mention OS details:

Ubuntu
Release 16.04.1 LTS (Xenial Xerus) 32-bit
Kernel Linux 4.4.0-47-generic i686
MATE 1.12.1