michaelstepner / pandoc-mustache

Pandoc filter for variable substitution using Mustache syntax
Creative Commons Zero v1.0 Universal
55 stars 14 forks source link

Crash - panflute "invalid API version" #12

Open lezsakdomi opened 2 years ago

lezsakdomi commented 2 years ago

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 commented 2 years ago

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 commented 1 year ago

Same here on ubuntu 22.04.02 panflute 2.0.5

loomanss commented 6 months ago

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