[Libreoffice-bugs] [Bug 116156] Python // officehelper.py misbehaves since 5.3.7

bugzilla-daemon at bugs.documentfoundation.org bugzilla-daemon at bugs.documentfoundation.org
Thu Jun 14 10:55:20 UTC 2018


https://bugs.documentfoundation.org/show_bug.cgi?id=116156

--- Comment #4 from mini-matze at web.de ---
I think a more better solution were to use subprocess instead of the "old"
os.spawn. So we need not care about quoting (and to set it as first arg, too).

add to imports:
from subprocess import Popen

Then we need to replace the process creation:
replace:
    os.spawnv(os.P_NOWAIT, sOffice, cmdArray)
with:
    Popen( cmdArray )


Or alternativ (because the first arg is the path to use - it's cleaner):
replace:
    cmdArray = (sOffice, "--nologo", "--nodefault",
"".join(["--accept=pipe,name=", sPipeName, ";urp;"]))
    os.spawnv(os.P_NOWAIT, sOffice, cmdArray)
with:
    cmdArray = ("--nologo", "--nodefault", "".join(["--accept=pipe,name=",
sPipeName, ";urp;"]))
    Popen( (sOffice,) + cmdArray )


Hope this helps...

-- 
You are receiving this mail because:
You are the assignee for the bug.
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <https://lists.freedesktop.org/archives/libreoffice-bugs/attachments/20180614/8c5a7f2f/attachment.html>


More information about the Libreoffice-bugs mailing list