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
Sphinx 1.8.0 fails build with syntax error unqualified exec is not allowed in function 'run' #5417
Comments
I posted the logs for one of our projects. But many of our projects that's using Sphinx started failing in our CI this morning with this issue after 1.8.0 was made public. |
This happens on Travis as well: https://travis-ci.org/adafruit/circuitpython/jobs/427888642#L1303 |
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com>
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8f2c660)
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8f2c660)
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8f2c660)
using sphinx 1.8.0 breaks our doc test CI job. Typical error: ``` Exception occurred: File "/home/jenkins-build/build/workspace/ceph-ansible-docs-pull-requests/docs/.tox/docs/lib/python2.7/site-packages/sphinx/highlighting.py", line 26, in <module> from sphinx.ext import doctest SyntaxError: unqualified exec is not allowed in function 'run' it contains a nested function with free variables (doctest.py, line 97) ``` See: sphinx-doc/sphinx#5417 Pinning to 1.7.9 to fix our CI. Signed-off-by: Guillaume Abrioux <gabrioux@redhat.com> (cherry picked from commit 8f2c660)
Sorry for inconvenience. This might be related with |
This seems to be caused by the way exec works; Maybe you guys want to specify the context to exec to avoid that issue. (I don't have the pretention to understand what it means or which context to apply) :) . Just trying to help as I'm impacted as well. |
Right now we'll use Sphinx !=1.8.0 in our requirements to unblock-- so we'll use 1.7.9 for the time being, and then 1.8.1 as soon as it's out. |
Sphinx pinned to 1.7.9 See sphinx-doc/sphinx#5417
Sphinx pinned to 1.7 See sphinx-doc/sphinx#5417
Pin Sphinx to 1.7.9 until sphinx-doc/sphinx#5417 is fixed.
Pin Sphinx to 1.7.9 until sphinx-doc/sphinx#5417 is fixed.
Work around sphinx-doc/sphinx#5417.
@tk0miya, the failing tests above seem to have been run on Python 2.7.5. Sphinx 1.8.0 only supports Python >=3.5. I tried this minimal test case to see differences in behavior between Python versions: def func():
context = {}
exec('print("hi")', context)
def inner():
return None
func()
I'll try to build Python 2.7.5 to see if there really is a difference between 2.7.5 and 2.7.15. On Python 2.6, changing the exec 'print("hi")' in context fixes the problem, but is not valid in Python 3.x. What still baffles me is that the Anyway, if it's true that this doesn't fail on any Python version >=3.5, do we still want to try and fix compatibility on Python <3.5? |
@akaihola No, Sphinx-1.8 has still supported python 2.7. So we should make a fix for both py27 and py34+ |
I confirmed with following Dockerfile:
|
Finally, I found the reason of the error. It seems list comprehension conflicts with
And it is already resolved at latest python2.7.
|
I confirmed #5443 fixes the problem:
|
Pin against sphinx 1.8.0 due to sphinx-doc/sphinx#5417.
Fix #5417: Sphinx fails to build with syntax error in Python 2.7.5
Fixed by #5443. |
Temporary workaround for this Sphinx issue: sphinx-doc/sphinx#5417
…uild_meta`` sdist directory argument to point to the same target (meaning the build frontend no longer needs to clean manually the dist dir to avoid multiple sdist presence, and setuptools no longer needs to handle conflicts between the two). Alexander Duryagin (6): always process module.__path__ for namespace packages, fixes #1321 added changelog.d entry xfail namespace packages tests on appveyor instead of skipping them change formatting to fix flake8 warning remove xfail for namespace tests that actually pass in AppVeyor remove xfail for AppVeyor from namespace tests entirely Bernat Gabor (4): build_meta.get_requires_for_build_sdist does not include wheel build_meta sdist directory delegate to --dist-dir Add tests exposing the issues with sdist_directory not being --dist-dir add changelog for #1481 Christian González (1): link to setuptools doc Jason R. Coombs (36): Reindent to avoid hanging indent. Delint Use unicode literals in test_easy_install. Delint Remove extraneous v Assign on separate lines Rely on rpartition. Suppress warnings in importer.find_module. Fixes #1111. Merge pull request #1489 from nerdoc/patch-1 Merge pull request #1479 from jdufresne/bytes Add Tidelift badge to readme Merge pull request #1486 from pypa/bugfix/1111-import-warning Configure readthedocs with a .yml file Merge pull request #1477 from gaborbernat/no-sdist-wheel Merge ancient easy_install history into changelog Remove backwards compatibility notes and future plans from Easy Install docs Update Easy Install docs reflecting the deprecation. Pin against sphinx 1.8.0 due to sphinx-doc/sphinx#5417. Fix broken reference to setuptools docs Fix other broken references due to moving changelog Merge pull request #1490 from pypa/bugfix/sphinx/5417 Merge pull request #1427 from stephenfin/touch-egg-info-directory Update changelog Merge pull request #1324 from torsava/safe_name Merge pull request #1402 from daa/pkg-resources-always-handle-namespace-package-path Minor reword Add periods to changelog entries Revert "Make safe_name compliant to PEP 503 and behaviour of pip > 8.1.2" Merge pull request #1491 from pypa/revert-1324-safe_name Bump version: 40.2.0 → 40.3.0 wordsmith changelog Merge pull request #1481 from gaborbernat/sdist-dir Bump version: 40.3.0 → 40.4.0 Update pavement not to import pip Bump to pyparsing 2.2.1 and re-run paver update_vendored. Fixes #1480. Bump version: 40.4.0 → 40.4.1 Jon Dufresne (2): Add tests for setuptools.glob Remove use of compatibility shim six.binary_type Stephen Finucane (3): gitignore: Ignore .venv directory trivial: Fix file permissions egg_info: Touch 'egg-info' directory Tomas Orsava (1): Make safe_name compliant to PEP 503 and behaviour of pip > 8.1.2 v40.4.1 ------- * #1480: Bump vendored pyparsing to 2.2.1. v40.4.0 ------- * #1481: Join the sdist ``--dist-dir`` and the ``build_meta`` sdist directory argument to point to the same target (meaning the build frontend no longer needs to clean manually the dist dir to avoid multiple sdist presence, and setuptools no longer needs to handle conflicts between the two). v40.3.0 ------- (NEWS truncated at 15 lines)
Problem
Procedure to reproduce the problem
This can be reproduced with docker too.
Error logs / results
Expected results
Docs successfully builds as it did on the previous release.
Reproducible project / your project
https://github.com/lfit/releng-lftools
Environment info
The text was updated successfully, but these errors were encountered: