joeyespo / grip

Preview GitHub README.md files locally before committing them.
MIT License
6.42k stars 423 forks source link

TypeError: required field "type_ignores" missing from Module #298

Open robertmarkbram opened 5 years ago

robertmarkbram commented 5 years ago

I have tried uninstalling and re-installing grip. I believe this may be to do with a bug in Python 3.8, but I don't see a way to change what version of Python grip will use (and I have the latest version of Python that Cygwin can give me - python3.8 --version: Python 3.8.0a3. Default python: python --version: Python 2.7.16

$ grip temp.md --export temp.html
Exporting to temp.html
Traceback (most recent call last):
  File "/usr/bin/grip", line 10, in <module>
    sys.exit(main())
  File "/usr/lib/python3.8/site-packages/grip/command.py", line 107, in main
    export(args['<path>'], args['--user-content'], args['--context'],
  File "/usr/lib/python3.8/site-packages/grip/api.py", line 116, in export
    page = render_page(path, user_content, context, username, password,
  File "/usr/lib/python3.8/site-packages/grip/api.py", line 80, in render_page
    return create_app(path, user_content, context, username, password,
  File "/usr/lib/python3.8/site-packages/grip/api.py", line 45, in create_app
    return grip_class(source, auth, renderer, None, render_wide,
  File "/usr/lib/python3.8/site-packages/grip/app.py", line 70, in __init__
    super(Grip, self).__init__(
  File "/usr/lib/python3.8/site-packages/flask/app.py", line 558, in __init__
    self.add_url_rule(
  File "/usr/lib/python3.8/site-packages/flask/app.py", line 66, in wrapper_func
    return f(self, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/flask/app.py", line 1216, in add_url_rule
    self.url_map.add(rule)
  File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 1388, in add
    rule.bind(self)
  File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 730, in bind
    self.compile()
  File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 794, in compile
    self._build = self._compile_builder(False).__get__(self, None)
  File "/usr/lib/python3.8/site-packages/werkzeug/routing.py", line 951, in _compile_builder
    code = compile(module, "<werkzeug routing>", "exec")
TypeError: required field "type_ignores" missing from Module
joeyespo commented 5 years ago

Nice catch, @robertmarkbram!

I added Python 3.8-dev to Travis in #301 to track this. Thanks for opening the issue!

harrywhite4 commented 4 years ago

Was going to look into fixing this, but ran the test and an export with python 3.8 and both worked fine.