<div dir="ltr"><div class="gmail_quote"><div dir="ltr" class="gmail_attr">On Sat, 6 Feb 2021 at 15:10, Pavel Sanda <<a href="mailto:sanda@lyx.org">sanda@lyx.org</a>> wrote:<br></div><blockquote class="gmail_quote" style="margin:0px 0px 0px 0.8ex;border-left:1px solid rgb(204,204,204);padding-left:1ex">On Sat, Feb 06, 2021 at 02:49:04PM +0100, Pavel Sanda wrote:<br>
> Command to execute:<br>
> "java" -jar "/home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar" Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmpnc1DfX<br>
> docbook2epub fails<br>
> sh: 1: java -jar /home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmpnc1DfX: not found<br>
> Systemcall.cpp (291): Systemcall: 'python "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py" "java" "Intro.xml" "Intro.epub"' finished with exit code 1<br>
> Error: Cannot convert file<br>
> <br>
> Not sure what went wrong, but going to terminal I do not see /tmp/tmpnc1DfX created.<br>
> Manually creating and running the java command leads to:<br>
<br>
The problem is not nonexistent dir, but qoutation for command, that's fixed by<br>
-    if os.system('"' + command + '"') != 0:<br>
+    if os.system(command) != 0:<br>
<br>
Now it continues by:<br>
Command to execute:<br>
"java" -jar "/home/lyx/lyx/devel/lib/scripts/../scripts/saxon6.5.5.jar" Intro.xml /home/lyx/lyx/devel/lib/scripts/../docbook/epub3/chunk.xsl base.dir=/tmp/tmp31wRYV<br>
Generated ePub contents.<br>
Writing /tmp/tmp31wRYV/OEBPS/toc.ncx for article<br>
Traceback (most recent call last):<br>
  File "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py", line 61, in <module><br>
    for file in glob.glob(output_dir + '/**/*', recursive=True):<br>
TypeError: glob() got an unexpected keyword argument 'recursive'<br>
Systemcall.cpp (291): Systemcall: 'python "/home/lyx/lyx/devel/lib/scripts/docbook2epub.py" "java" "Intro.xml" "Intro.epub"' finished with exit code 1<br>
Error: Cannot convert file<br>
<br>
I am not pythonist, so I leave an unexpected keyword argument 'recursive' to someone else. <br></blockquote><div><br></div><div>I've just pushed patches for these problems. Quotes are required in some edge cases on Windows, so I added a switch based on the OS (a cleaner solution would be to use the subprocess module, but its current API was added in Python 3.5). The second error is due to an older version of Python: I added a work-around that should work on all versions, and at least it still works for me.<br></div></div></div>