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

Warnings of "data file translations/en.yaml not found" although file exists #354

Open
novoid opened this issue Jan 7, 2024 · 3 comments

Comments

@novoid
Copy link

novoid commented Jan 7, 2024

Hi,

I've got a Debian stable host running pandoc 2.17.1.1, pypandoc 1.10, Python 3.11.2 and I do have an issue when running https://github.com/novoid/lazyblorg/ in a virtualenv in case that this matters.

The issue consists of many warning messages, "polluting" the output console with those snippets:

WARNING:pypandoc:Could not load translations for en-US
  data file translations/en.yaml not found
WARNING:pypandoc:The term Abstract has no translation defined.

One for each pypandoc call, which it uses often.

I already "disabled" logging messages via logging.getLogger('pypandoc').addHandler(logging.NullHandler()) as described in the README. This removed some other output but not the one above.

I tried to symlink the translations dir according to hints from jgm/pandoc#6885

mkdir ~/.pandoc/     
cd ~/.pandoc/
ln -s /usr/share/pandoc/data/translations .
ls ~/.pandoc/translations/en.yaml   ## shows correct file

That didn't help.

I could not identify any relevant PATH parameter in convert_text() from https://github.com/JessicaTegner/pypandoc/blob/master/pypandoc/__init__.py which would allow me to set the data/translations path.

Furthermore, I did not find any pandoc option I would have been able to use with the extra_args of convert_text().

Somehow, (py)pandoc is not able to locate the existing translation file /usr/share/pandoc/data/translations/en.yaml.

Not that this file is needed in my case but I think it would solve my issue when (py)pandoc would be able to access that file.

Any idea what I could do to fix this?

@JessicaTegner
Copy link
Owner

Hmm. Interesting one.

The log output you provided, suggest that it's "pandoc" that can't find the translation file, however I have never seen this before.

I know running pypandoc in a venv shouldn't effect this. My only suggestions would be to either try to set the data dir argument when using convert_*, check the pandoc documentation, or asking JGM about it as this seems more like a pandoc issue more than a (py)pandoc issue

@novoid
Copy link
Author

novoid commented Jan 18, 2024

I may not be that familiar with calling pandoc in the shell. What would be a command line to reproduce the issue without the whole Python layer?

Simple "pandoc input.org -o output.pdf" calls are working without that warning message, for example.

@danielkauffman
Copy link

Identical issue, likewise on Debian stable running pandoc 2.17.1.1, pypandoc 1.7.4, and python 3.11.2.

Resolved (for my purposes) by upgrading pandoc and pypandoc from Debian testing to pandoc 3.1.3, pypandoc 1.12.

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

3 participants