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

Crash - panflute "invalid API version" #12

Open
lezsakdomi opened this issue Apr 26, 2022 · 3 comments
Open

Crash - panflute "invalid API version" #12

lezsakdomi opened this issue Apr 26, 2022 · 3 comments

Comments

@lezsakdomi
Copy link

lezsakdomi commented Apr 26, 2022

I've just issued pip install pandoc-plantuml-filter; pip install -U pandoc-mustache on WSL with ubuntu-20.04, and tried running pandoc with both filters.

Here is the console output:

Traceback (most recent call last):
  File "/home/led/.local/bin//pandoc-mustache", line 8, in <module>
    sys.exit(main())
  File "/home/led/.local/lib/python3.8/site-packages/pandoc_mustache/pandoc_mustache.py", line 36, in main
    return run_filter(action, prepare=prepare, doc=doc)
  File "/home/led/.local/lib/python3.8/site-packages/panflute/io.py", line 224, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/home/led/.local/lib/python3.8/site-packages/panflute/io.py", line 197, in run_filters
    doc = load(input_stream=input_stream)
  File "/home/led/.local/lib/python3.8/site-packages/panflute/io.py", line 58, in load
    doc = json.load(input_stream, object_hook=from_json)
  File "/usr/lib/python3.8/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.8/json/__init__.py", line 370, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.8/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.8/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "/home/led/.local/lib/python3.8/site-packages/panflute/elements.py", line 1353, in from_json
    return Doc(*items, api_version=api, metadata=meta)
  File "/home/led/.local/lib/python3.8/site-packages/panflute/elements.py", line 66, in __init__
    raise TypeError("invalid api version", api_version)
TypeError: ('invalid api version', [1, 17, 5, 4])
Error running filter pandoc-mustache:
Filter returned error status 1

Can you reproduce this bug?

@tomsib2001
Copy link

Same error here:

Traceback (most recent call last):
  File "/home/thomas/.local/bin/pandoc-mustache", line 8, in <module>
    sys.exit(main())
  File "/home/thomas/.local/lib/python3.10/site-packages/pandoc_mustache/pandoc_mustache.py", line 36, in main
    return run_filter(action, prepare=prepare, doc=doc)
  File "/home/thomas/.local/lib/python3.10/site-packages/panflute/io.py", line 227, in run_filter
    return run_filters([action], *args, **kwargs)
  File "/home/thomas/.local/lib/python3.10/site-packages/panflute/io.py", line 200, in run_filters
    doc = load(input_stream=input_stream)
  File "/home/thomas/.local/lib/python3.10/site-packages/panflute/io.py", line 58, in load
    doc = json.load(input_stream, object_hook=from_json)
  File "/usr/lib/python3.10/json/__init__.py", line 293, in load
    return loads(fp.read(),
  File "/usr/lib/python3.10/json/__init__.py", line 359, in loads
    return cls(**kw).decode(s)
  File "/usr/lib/python3.10/json/decoder.py", line 337, in decode
    obj, end = self.raw_decode(s, idx=_w(s, 0).end())
  File "/usr/lib/python3.10/json/decoder.py", line 353, in raw_decode
    obj, end = self.scan_once(s, idx)
  File "/home/thomas/.local/lib/python3.10/site-packages/panflute/elements.py", line 1362, in from_json
    return Doc(*items, api_version=api, metadata=meta)
  File "/home/thomas/.local/lib/python3.10/site-packages/panflute/elements.py", line 66, in __init__
    raise TypeError("invalid api version", api_version)
TypeError: ('invalid api version', [1, 20])
Error running filter pandoc-mustache:
Filter returned error status 1
make: *** [Makefile:6 : manuscrit] Erreur 83

@mm-ruhri
Copy link

Same here on ubuntu 22.04.02
panflute 2.0.5

@loomanss
Copy link

had same error

fixed by checking version compatibility between panflute and pandoc on https://github.com/sergiocorreia/panflute

and installing correct pandoc version:

sudo apt remove pandoc
cd /tmp/
wget https://github.com/jgm/pandoc/releases/download/3.1.13/pandoc-3.1.13-1-amd64.deb
sudo apt install -f /tmp/pandoc-3.1.13-1-amd64.deb

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

4 participants