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

python3.8: Sphinx docs generation, ast.py related error #1781

Closed
osuchw opened this issue Nov 10, 2019 · 3 comments
Closed

python3.8: Sphinx docs generation, ast.py related error #1781

osuchw opened this issue Nov 10, 2019 · 3 comments

Comments

@osuchw
Copy link
Contributor

osuchw commented Nov 10, 2019

ast.py changes in Python3.8 broke Sphinx documentation generator resulting in SyntaxError.

# Sphinx version: 2.2.1
# Python version: 3.8.0 (CPython)
# Docutils version: 0.15.2 release
# Jinja2 version: 2.10.3
# Last messages:

# Loaded extensions:
Traceback (most recent call last):
  File "c:\py\python38\lib\site-packages\sphinx\cmd\build.py", line 272, in build_main
    app = Sphinx(args.sourcedir, args.confdir, args.outputdir,
  File "c:\py\python38\lib\site-packages\sphinx\application.py", line 269, in __init__
    self._init_builder()
  File "c:\py\python38\lib\site-packages\sphinx\application.py", line 330, in _init_builder
    self.events.emit('builder-inited')
  File "c:\py\python38\lib\site-packages\sphinx\events.py", line 103, in emit
    results.append(callback(self.app, *args))
  File "c:\src\altair\altair\sphinxext\altairgallery.py", line 268, in main
    save_example_pngs(examples, image_dir)
  File "c:\src\altair\altair\sphinxext\altairgallery.py", line 130, in save_example_pngs
    chart = eval_block(example['code'])
  File "c:\src\altair\altair\utils\execeval.py", line 38, in eval_block
    tree = ast.parse(code, filename='<ast>', mode='exec')
  File "c:\py\python38\lib\ast.py", line 47, in parse
    return compile(source, filename, mode, flags,
  File "<ast>", line 1
    Anscombe's Quartet
                     ^
SyntaxError: EOL while scanning string literal

A patch with a possible fix attached.

py38-docgen.patch.txt

@jakevdp
Copy link
Collaborator

jakevdp commented Nov 10, 2019

Thanks! Would you be willing to open a pull request with your change?

osuchw added a commit to osuchw/altair that referenced this issue Nov 11, 2019
@osuchw
Copy link
Contributor Author

osuchw commented Nov 11, 2019

Pull request #1782 created.

jakevdp added a commit that referenced this issue Nov 11, 2019
@jakevdp
Copy link
Collaborator

jakevdp commented Nov 11, 2019

Closed by #1782

@jakevdp jakevdp closed this as completed Nov 11, 2019
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