Possibly bug with export to epub
Thibaut Cuvelier
dourouc05 at gmail.com
Mon Nov 11 22:52:18 UTC 2024
On Mon, 11 Nov 2024 at 19:01, José Matos <jaomatos at gmail.com> wrote:
> On Wed, 2024-11-06 at 20:16 +0100, Bernd Nitzschmann wrote:
> > Hi lyx-devel,
> > I hope this is the right place to report a feature not working (at
> > least for me):
> >
> > When trying to export a lyx file to epub format an error message pops
> > up:
> > An error occurred while executing
> > py -3 -tt $$s/scripts/docbook2epub.py "java" none none none
> > "<file>.XML" "<Path>" "<file>.epub"
> >
> > I got suspicious about the "$$s...", therefore this message.
> >
> > For comparison, I started exports to odt and txt formats which worked
> > fine.
> > The lyx-file compiles to PDF without errors.
> > LyX-Version: 2.4.2.1
> > Platform: Windows 10
> >
> > Kind regards,
> > Bernd Nitzschmann
> > 24afc79c-7530-4b0a-b985-9f65c6d68a8f
>
> @Thibaut does this works for you, exporting to ePub?
>
> I am trying to understand if this works on Windows. In particular I can
> see above that the python placeholder is replaced, as it should, but
> the system directory ($$s) is not.
>
> I fixed a case where the $${python} place holder was not but I do not
> remember any problem with $$s.
>
I cannot export the User's Guide to ePub, but that's expected (the UG is
too complex to be handled properly). For reference, here is the complete
error message for the UG:
UserGuide.xml:7646: parser error : Specification mandates value for
attribute Header
<Left Header>
^
UserGuide.xml:7649: parser error : expected '>'
</Left Header>
^
UserGuide.xml:7650: parser error : Specification mandates value for
attribute Header
<Center Header>
^
UserGuide.xml:7653: parser error : expected '>'
</Center Header>
^
UserGuide.xml:7654: parser error : Specification mandates value for
attribute Header
<Right Header>
^
UserGuide.xml:7657: parser error : expected '>'
</Right Header>
^
UserGuide.xml:7658: parser error : Specification mandates value for
attribute Footer
<Left Footer>
^
UserGuide.xml:7661: parser error : expected '>'
</Left Footer>
^
UserGuide.xml:7662: parser error : Specification mandates value for
attribute Footer
<Center Footer>
^
UserGuide.xml:7681: parser error : expected '>'
</Center Footer>
^
UserGuide.xml:7682: parser error : Specification mandates value for
attribute Footer
<Right Footer>
^
UserGuide.xml:7685: parser error : expected '>'
</Right Footer>
^
unable to parse UserGuide.xml
Generating ePub with the following parameters:
C:/Program Files/LyX 2.4/Resources/scripts/docbook2epub.py
None
None
xsltproc
None
UserGuide.xml
C:/Program Files/LyX 2.4/Resources/doc/
UserGuide.epub
Temporary output directory: C:/Users/Thibaut/AppData/Local/Temp/tmp7iex8g6j
XSLT style sheet to use:
C:/Program Files/LyX 2.4/Resources/scripts/../docbook/epub3/chunk.xsl
Command to execute:
"xsltproc" -stringparam base.dir
"C:/Users/Thibaut/AppData/Local/Temp/tmp7iex8g6j" "C:/Program Files/LyX
2.4/Resources/scripts/../docbook/epub3/chunk.xsl" "UserGuide.xml"
docbook2epub fails: error from the XSLT processor
support\Systemcall.cpp (306): Systemcall: 'py -3 -tt "C:/Program Files/LyX
2.4/Resources/scripts/docbook2epub.py" none none "xsltproc" none
"UserGuide.xml" "C:/Program Files/LyX 2.4/Resources/doc/" "UserGuide.epub"'
finished with exit code 1
Error: Cannot convert file
----------------------------------------
An error occurred while running:
py -3 -tt $$s/scripts/docbook2epub.py none none "xsltproc" none
"UserGuide.xml"
"C:/Program Files/LyX 2.4/Resources/doc/" "UserGuide.epub"
However, for a simple file, I get IO errors:
Writing
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/ar01-toc.xhtml for
article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/ar01-toc.xhtml
Writing C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/index.xhtml
for article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/index.xhtml
Writing
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/docbook-epub.css for
article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/docbook-epub.css
Generating EPUB package files.
Generating image list ...
Writing C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/package.opf
for article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/package.opf
Writing
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/../META-INF/container.xml
for article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/../META-INF/container.xml
Writing C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/../mimetype
for article
Generating NCX file ...
Writing C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/toc.ncx for
article
I/O error : No such file or directory
runtime error: file
file:/C:/Program%20Files/LyX%202.4/Resources/docbook/xhtml/chunker.xsl line
167 element document
xsltDocumentElem: unable to save to
C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w/OEBPS/toc.ncx
no result for newfile1.xml
Generating ePub with the following parameters:
C:/Program Files/LyX 2.4/Resources/scripts/docbook2epub.py
None
None
xsltproc
None
newfile1.xml
C:/Users/Thibaut/Desktop/
newfile1.epub
Temporary output directory: C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w
XSLT style sheet to use:
C:/Program Files/LyX 2.4/Resources/scripts/../docbook/epub3/chunk.xsl
Command to execute:
"xsltproc" -stringparam base.dir
"C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w" "C:/Program Files/LyX
2.4/Resources/scripts/../docbook/epub3/chunk.xsl" "newfile1.xml"
docbook2epub fails: error from the XSLT processor
support\Systemcall.cpp (306): Systemcall: 'py -3 -tt "C:/Program Files/LyX
2.4/Resources/scripts/docbook2epub.py" none none "xsltproc" none
"newfile1.xml" "C:/Users/Thibaut/Desktop/" "newfile1.epub"' finished with
exit code 1
Error: Cannot convert file
----------------------------------------
An error occurred while running:
py -3 -tt $$s/scripts/docbook2epub.py none none "xsltproc" none
"newfile1.xml"
"C:/Users/Thibaut/Desktop/" "newfile1.epub"
Indeed, the folder C:/Users/Thibaut/AppData/Local/Temp/tmpgtma4y2w doesn't
exist. LyX' working directory is
C:\Users\Thibaut\AppData\Local\Temp\lyx_tmpdir.LuiLlvEvGCXt. It seems like
the temporary folder created by
tempfile.mkdtemp()
(docbook2epub.py) is not accessible to the XSLT engine… (There is no way
for me to access this folder, as Python deletes it as soon as the script is
done.)
Creating the folders seems to solve the problem. I have pushed two commits
that solve the problem (the second one is just about having a slightly
nicer log):
1381e3e5752b9eb29a8139b9da87f475f9569522
637ae9528fbb38f4ea426dcbfacfc1772f61d148
These should be backported to 2.4. (Testing was done on 2.4.0, Windows x64.)
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.lyx.org/pipermail/lyx-devel/attachments/20241111/a2b9b1ae/attachment-0001.htm>
More information about the lyx-devel
mailing list