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

[fix] py3 compatibility #30710

Closed
wants to merge 1 commit into
base: devel
from

Conversation

Projects
None yet
4 participants
@4383
Contributor

4383 commented Sep 21, 2017

SUMMARY

fix python3 error on documentation generation make docs with python3.5.
Using sys.maxsize instead of sys.maxint

ISSUE TYPE
  • Bugfix Pull Request
COMPONENT NAME

docs/bin/generate_man.py

ANSIBLE VERSION
ansible 2.5.0 (bugfix/docs_py3_compatibility 567b236ebf) last updated 2017/09/21 17:59:14 (GMT +200)
  config file = None
  configured module search path = ['/home/herve/.ansible/plugins/modules', '/usr/share/ansible/plugins/modules']
  ansible python module location = /home/herve/dev/ansible/lib/ansible
  executable location = /usr/local/bin/ansible
  python version = 3.5.2 (default, Nov 17 2016, 17:05:23) [GCC 5.4.0 20160609]

ADDITIONAL INFORMATION

before changes

make docs
mkdir -p ./docs/man/man1/ ; \
PYTHONPATH=./lib docs/bin/generate_man.py --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
Traceback (most recent call last):
  File "docs/bin/generate_man.py", line 253, in <module>
    allvars[cli_name] = opts_docs(cli_class_name, cli_name)
  File "docs/bin/generate_man.py", line 119, in opts_docs
    'long_desc': trim_docstring(cli.__doc__),
  File "docs/bin/generate_man.py", line 34, in trim_docstring
    indent = sys.maxint
AttributeError: module 'sys' has no attribute 'maxint'
Makefile:347 : la recette pour la cible « generate_asciidoc » a échouée
make: *** [generate_asciidoc] Erreur 1

after changes

make docs
mkdir -p ./docs/man/man1/ ; \
PYTHONPATH=./lib docs/bin/generate_man.py --template-file=docs/templates/man.j2 --output-dir=docs/man/man1/ --output-format man lib/ansible/cli/*.py
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible-config.1.asciidoc.in
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible-pull.1.asciidoc.in
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible.1.asciidoc.in
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible-inventory.1.asciidoc.in
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible-console.1.asciidoc.in
Wrote doc to /home/herve/dev/ansible/docs/man/man1/ansible-doc.1.asciidoc.in
Hervé Beraud
@ansibot

This comment has been minimized.

Contributor

ansibot commented Sep 21, 2017

@pilou-

This comment has been minimized.

Contributor

pilou- commented Sep 27, 2017

sys.maxsize is available in Python 2.7 and Python 3.3, sys.maxint isn't currently used in this file.

@4383

This comment has been minimized.

Contributor

4383 commented Sep 27, 2017

@dharmabumstead (as randomly selected maintainer of docs namespace) could you please review this pull request ?

@4383

This comment has been minimized.

Contributor

4383 commented Sep 27, 2017

Fixed by #30424

@4383 4383 closed this Sep 27, 2017

@ansibot ansibot added docs bug and removed docs_pull_request labels Mar 4, 2018

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment