-
Notifications
You must be signed in to change notification settings - Fork 23.7k
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
"webdocs" make target fails under Python 3 #13463
Comments
ansible itself does not work with python3, we have made much progress in adding support for it, but are not there yet. we have not even started looking at things like the build utilities for documentation or anything else. |
Good time as any to start? |
submit as a PR, then we can test and merge if possible. |
Will do! |
This issue affects at least the "devel" and "stable-2.0" branches. Given that "Patches should always be made against the ‘devel’ branch.", I'm updating this bug report and will submit the PR against the "devel" branch. |
See #13470. Note that that PR is made against the "devel" branch, not the "stable-2.0" branch. |
@Ichimonji10 that is fine, PRs should always go against devel, we will backport if needed (since 2.0 is in feature freeze, this will probably be in 2.1) |
OK. Good to know I'm on the right track. |
Closed as the above was merged in, thanks again! |
The `webdocs` make target fails under Python 3. It fails due to a variety of syntax errors, such as the use of `except Foo, e` and `print 'foo'`. Fix #13463 by making code compatible with both Python 2 and 3.
The `webdocs` make target fails under Python 3. It fails due to a variety of syntax errors, such as the use of `except Foo, e` and `print 'foo'`. Fix ansible#13463 by making code compatible with both Python 2 and 3.
Thank you both. |
This bug was originally filed against version 2.0.0-0.7.rc2. However, this bug is also reproductible on the "devel" branch, and probably other branches too. Keep that in mind when reading the remainder of this issue.
Issue Type
Bug Report
Ansible Version
I'm running Ansible 2.0.0-0.7.rc2:
More precisely:
Ansible Configuration
I have changed nothing. I am running directly from the git repository.
Environment
I'm running an up-to-date version of Arch Linux. However, that shouldn't matter much, given that Ansible itself is running in a virtualenv. The virtualenv setup procedure is as follows:
I do the same for Python 3 by setting
N=3
and repeating the procedure. The Python versions as reported bypython --version
arePython 2.7.10
andPython 3.5.0
.Summary
The
webdocs
make target fails for Ansible v2.0.0-0.7.rc7 under Python 3. It fails due to a variety of syntax errors, such as the use ofexcept Foo, e
andprint 'foo'
.Steps To Reproduce
Create a virtualenv and install ansible from source, as outlined in the "Environment" section. Execute
make webdocs
.Expected Results
make webdocs
completes and produces usable documentation.Actual Results
make webdocs
completes under Python 2, but not Python 3.Proposed Fix
According to Community Information & Contributing → Ansible Users → Contributing Code (Features or Bugfixes), "code developed for Ansible needs to support Python 2.6+". According to that standard, it should be OK to do things like replace a
except Foo, e
withexcept Foo as e
.In my environment (Python 2.7.10 and 3.5.0), the following change works allows me to execute
make webdocs
under Python 2 and 3. However, I'm not sure how to properly test this change to ensure it does not break anything.The text was updated successfully, but these errors were encountered: