New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Latexmlc epub generation fails on Windows #806

Closed
charlyms opened this Issue Oct 22, 2016 · 13 comments

Comments

Projects
None yet
4 participants
@charlyms

charlyms commented Oct 22, 2016

Hello,
I tried to convert some arxiv.org-stuff from source to epub but failed with Windows 10:

C:\Users\Klaus\Eigene Dokumente\Anne\HERUS A CO Atlas from SPIRE Spectroscopy of local ULIRGs~>latexmlc herusfts_ajs_forastroph.tex --destination=book.epub
latexmlc (LaTeXML version 0.8.2) : these path directories do not exist: C:/Users/Klaus/Eigene\ Dokumente/Anne/HERUS\ A\ CO\ Atlas\ from\ SPIRE\ Spectroscopy\ of\ local\ ULIRGs~
(Loading C:\Strawberry\perl\site\lib\LaTeXML\Package\TeX.pool.ltxml...
(Loading C:\Strawberry\perl\site\lib\LaTeXML\Package\eTeX.pool.ltxml... 0.00 sec)
(Loading C:\Strawberry\perl\site\lib\LaTeXML\Package\pdfTeX.pool.ltxml... 0.01 sec) 0.20 sec)
latexmlc (LaTeXML version 0.8.2)
processing started Sat Oct 22 20:24:47 2016...

Calibre cannot open the file:
Traceback (most recent call last):
  File "site-packages\calibre\utils\ipc\simple_worker.py", line 286, in main
  File "site-packages\calibre\ebooks\oeb\iterator\book.py", line 64, in extract_book
  File "site-packages\calibre\customize\conversion.py", line 245, in __call__
  File "site-packages\calibre\ebooks\conversion\plugins\epub_input.py", line 238, in convert
  File "site-packages\calibre\utils\localunzip.py", line 231, in extractall
  File "site-packages\calibre\utils\localunzip.py", line 187, in _extractall
AttributeError: 'NoneType' object has no attribute 'replace'

Trying with Ubuntu 16.04 I succeed.

charlyms@ubuntu:~/Dokumente/HERUS A CO Atlas from SPIRE Spectroscopy of local ULIRGs~$ latexmlc herusfts_ajs_forastroph.tex --destination=book.epub
latexmlc (LaTeXML version 0.8.1) : these path directories do not exist: /home/charlyms/Dokumente/HERUS\ A\ CO\ Atlas\ from\ SPIRE\ Spectroscopy\ of\ local\ ULIRGs~
(Loading /usr/share/perl5/LaTeXML/Package/TeX.pool.ltxml...
(Loading /usr/share/perl5/LaTeXML/Package/eTeX.pool.ltxml... 0.04 sec)
(Loading /usr/share/perl5/LaTeXML/Package/pdfTeX.pool.ltxml... 0.01 sec) 0.20 sec)
latexmlc (LaTeXML version 0.8.1)
processing started Sat Oct 22 13:36:22 2016...

Do this depend on the different versions of LaTeXML?
Regards from Germany
Charlyms

@dginev

This comment has been minimized.

Collaborator

dginev commented Oct 22, 2016

Hi @charlyms ,

the error you've pasted from the Windows run comes from Calibre rather than LaTeXML, which is rather confusing. How is calibre involved?

As a general remark, latexml is developed and tested most heavily under linux, so you're bound to avoid a class of potential OS-compatibility problems by using it under Ubuntu. But we're happy to help fix Windows issues as well.

@dginev dginev added the question label Oct 22, 2016

@dginev dginev added this to the LaTeXML-0.8.3 milestone Oct 22, 2016

@charlyms

This comment has been minimized.

charlyms commented Oct 22, 2016

I agree to OS-compatibility problems, but strange enough Calibre (Windows) opens epub-files converted on Ubuntu and not of it´s own OS.
I tried to open the file on Calibre (Ubuntu) with no probblems.
Trying to open the windows-file failed as aspected:

Traceback (most recent call last):
File "/usr/lib/calibre/calibre/utils/ipc/simple_worker.py", line 274, in main
res = {'result':func(_args, *_kwargs)}
File "/usr/lib/calibre/calibre/ebooks/oeb/iterator/book.py", line 62, in extract_book
plumber.opts, plumber.input_fmt, log, {}, tdir)
File "/usr/lib/calibre/calibre/customize/conversion.py", line 241, in call
log, accelerators)
File "/usr/lib/calibre/calibre/ebooks/conversion/plugins/epub_input.py", line 197, in convert
extractall(stream)
File "/usr/lib/calibre/calibre/utils/localunzip.py", line 223, in extractall
_extractall(f, path)
File "/usr/lib/calibre/calibre/utils/localunzip.py", line 179, in _extractall
fname = header.filename.replace(os.sep, '/')
AttributeError: 'NoneType' object has no attribute 'replace'.
So there are some incompatibilities I cannot locate.
Latexmlc seems to be no friend of Windows. By the way I cannot open the windows-file with other Windows programms like FBReader.
Kind regards from Germany
Charlyms

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Nov 27, 2016

So, if I'm following this, you're getting different epub files from running latexmlc on windows and ubuntu? And the one produced on windows isn't accepted by calibre? (on windows, unbuntu, or both?).

If that's the case, I guess it would be necessary to compare the two files and see what's different about them. Alas @dginev is the epub expert around here :>

@charlyms

This comment has been minimized.

charlyms commented Nov 27, 2016

The files produced by Windows are not accepted on Windows and Ubuntu!
Can you put the blame on Calibre?
Regards from Germany
Charlyms

@charlyms charlyms closed this Nov 27, 2016

@dginev

This comment has been minimized.

Collaborator

dginev commented Nov 27, 2016

@charlyms earlier you had said they worked under Ubuntu, is that still the case? If it's a OS-difference in Calibre that is responsible, then it is indeed out of our hands here.

If you think latexml is producing invalid/unacceptable epub, it would be really great to include an example file with some details, so that I can quickly patch it.

But indeed calibre issues should be taken to the calibre team, sadly we can't be of much help on that front. Thanks for letting us know!

@charlyms

This comment has been minimized.

charlyms commented Nov 27, 2016

Hello,
I hope there is no missunderstanding, but I have to underline, that latexmlc on (my) Windows is not able to produce proper epub-files both for Windows and Ubuntu while this command on Ubuntu does.
Unfortunately Github don´t support uploading epub-files.
Please try http://www.filedropper.com/book_1.
I cannot decide who the culprit is. But if the command works on Ubuntu it has to work on Windows.
Maybe there is something missing?
Regards from Germany
Charlyms

@charlyms charlyms reopened this Nov 27, 2016

@dginev dginev added bug postprocessing and removed question labels Nov 27, 2016

@dginev dginev changed the title from Latexmlc on Windows and Ubuntu to Latexmlc epub generation fails on Windows Nov 27, 2016

@dginev

This comment has been minimized.

Collaborator

dginev commented Nov 27, 2016

Thanks, I have reclassified the issue and will take a look.

Sadly, I no longer actively maintain a Windows installation of latexml, as it is not my primary operating system for development. If there is anyone reading this issue who is interested in helping with maintenance of latexml under Windows, help would be very highly appreciated!

@dginev dginev added the portability label Nov 27, 2016

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Nov 28, 2016

There's at least this misunderstanding: we never said that the problem is with calibre (although it ultimately might be.) The file you posted on filedropper: is that the epub produced under windows? It appears to be corrupt. I can't tell if that interpretation is consistent with the python stack trace.

@charlyms

This comment has been minimized.

charlyms commented Nov 28, 2016

Hello,
Yes it´s the file. I downloaded and testested it myself. It seems not to be modified anyway, the error-messages are the same as I posted before. So you might call this corrupt.
So I cannot understand why you test it yourself? Just build an epub-file under Win10 and try or let try to open it by Calibre.
Regards from Germany
Charlyms

@charlyms charlyms closed this Nov 28, 2016

@dginev dginev reopened this Nov 28, 2016

@dginev

This comment has been minimized.

Collaborator

dginev commented Nov 28, 2016

Just build an epub-file under Win10 and try or let try to open it by Calibre.

That's what "testing myself" meant above.

@senthilmm

This comment has been minimized.

senthilmm commented Feb 8, 2017

Thanks, I have reclassified the issue and will take a look.

Sadly, I no longer actively maintain a Windows installation of latexml, as it is not my primary operating system for development. If there is anyone reading this issue who is interested in helping with maintenance of latexml under Windows, help would be very highly appreciated!

What are all the prerequisites to be a maintainer of latexml under windows. I am interested.

@brucemiller

This comment has been minimized.

Owner

brucemiller commented Feb 8, 2017

@senthilmm: Cool! I think the main prerequisite is a willingness to try! :>

Really, just windows, use a git clone, rather than only official releases, and enough familiarity with Perl (or good programming instincts) to experiment a bit. Our main problems with Windows, I think, are simply the collisions between our unixy intuitions about pathnames and callouts to the commandline (eg. kpsewhich) that clash with the windows ways of doing things. Past cases have found that counterintuitive (to me) trickery is needed to properly quote paths & commandlines that probably come natural to folks versed in Windows.

@dginev

This comment has been minimized.

Collaborator

dginev commented Mar 19, 2018

I think this issue is a duplicate of #827 , and is also fixed by the latest encoding PR #960 . Apologies to all for the broken ePub files on Windows!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment