Skip to content
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

test_pdf_conversion fails on macos when pdflatex is missing #239

Open
jayvdb opened this issue Nov 23, 2021 · 1 comment
Open

test_pdf_conversion fails on macos when pdflatex is missing #239

jayvdb opened this issue Nov 23, 2021 · 1 comment

Comments

@jayvdb
Copy link
Contributor

jayvdb commented Nov 23, 2021

When running on Python 3.9 , and without pdflatex installed (part of brew package mactex).

ERROR: test_pdf_conversion (__main__.TestPypandoc)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/Users/jayvdb/inv/pypandoc/tests.py", line 318, in test_pdf_conversion
    ret = pypandoc.convert_text('# some title\n', to='pdf', format='md', outputfile=file_name)
  File "/Users/jayvdb/inv/pypandoc/pypandoc/__init__.py", line 100, in convert_text
    return _convert_input(source, format, 'string', to, extra_args=extra_args,
  File "/Users/jayvdb/inv/pypandoc/pypandoc/__init__.py", line 335, in _convert_input
    raise RuntimeError(
RuntimeError: Pandoc died with exitcode "1" during conversion: pandoc: pdflatex: createProcess: posix_spawnp: illegal operation (Inappropriate ioctl for device)

This is a overly complicated exception message that many users wont recognise as "I need to install pdflatex".
As it is possible to use alternative latex engines, it would be best to catch this error, detect "pdflatex" in the message, check for whether pdflatex is in the PATH, and provide a better exception message only if it is missing.

@JessicaTegner
Copy link
Owner

JessicaTegner commented Nov 23, 2021

yes I agree.
In addition, I would guess that missing the other engines (if used) would also yield just as complicated an error message, so maybe we should do that for all the engines.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants