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

[fix] py3 compatibility #30710

Closed
wants to merge 1 commit into from
Closed

Conversation

4383
Copy link
Contributor

@4383 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

@ansibot
Copy link
Contributor

ansibot commented Sep 21, 2017

@ansibot ansibot added affects_2.5 This issue/PR affects Ansible v2.5 bugfix_pull_request needs_triage Needs a first human triage before being processed. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team. labels Sep 21, 2017
@mscherer mscherer removed the needs_triage Needs a first human triage before being processed. label Sep 21, 2017
@pilou-
Copy link
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
Copy link
Contributor Author

4383 commented Sep 27, 2017

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

@4383
Copy link
Contributor Author

4383 commented Sep 27, 2017

Fixed by #30424

@4383 4383 closed this Sep 27, 2017
@ansibot ansibot added docs This issue/PR relates to or includes documentation. bug This issue/PR relates to a bug. and removed docs_pull_request labels Mar 4, 2018
@ansible ansible locked and limited conversation to collaborators Apr 26, 2019
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
affects_2.5 This issue/PR affects Ansible v2.5 bug This issue/PR relates to a bug. docs This issue/PR relates to or includes documentation. python3 support:core This issue/PR relates to code supported by the Ansible Engineering Team.
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants