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

sphinx is not py3k compatible #63447

Closed
kousu mannequin opened this issue Oct 13, 2013 · 6 comments
Closed

sphinx is not py3k compatible #63447

kousu mannequin opened this issue Oct 13, 2013 · 6 comments
Labels
docs Documentation in the Doc dir

Comments

@kousu
Copy link
Mannequin

kousu mannequin commented Oct 13, 2013

BPO 19248
Nosy @birkenfeld, @kousu, @ezio-melotti
Superseder
  • bpo-10224: Build 3.x documentation using python3.x
  • Files
  • sphinx_version_check.patch
  • Note: these values reflect the state of the issue at the time it was migrated and might not reflect the current state.

    Show more details

    GitHub fields:

    assignee = None
    closed_at = <Date 2013-10-13.20:19:42.317>
    created_at = <Date 2013-10-13.19:09:31.192>
    labels = ['docs']
    title = 'sphinx is not py3k compatible'
    updated_at = <Date 2013-10-13.20:42:23.748>
    user = 'https://github.com/kousu'

    bugs.python.org fields:

    activity = <Date 2013-10-13.20:42:23.748>
    actor = 'Arfrever'
    assignee = 'docs@python'
    closed = True
    closed_date = <Date 2013-10-13.20:19:42.317>
    closer = 'python-dev'
    components = ['Documentation']
    creation = <Date 2013-10-13.19:09:31.192>
    creator = 'kousu'
    dependencies = []
    files = ['32093']
    hgrepos = []
    issue_num = 19248
    keywords = ['patch']
    message_count = 6.0
    messages = ['199764', '199765', '199766', '199767', '199791', '199796']
    nosy_count = 6.0
    nosy_names = ['georg.brandl', 'kousu', 'ezio.melotti', 'Arfrever', 'docs@python', 'python-dev']
    pr_nums = []
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = '10224'
    type = None
    url = 'https://bugs.python.org/issue19248'
    versions = ['Python 3.1', 'Python 3.2', 'Python 3.3', 'Python 3.4', 'Python 3.5']

    @kousu
    Copy link
    Mannequin Author

    kousu mannequin commented Oct 13, 2013

    I'm running Arch. I just checked out python's hg and tried to build the docs, and found that I couldn't:

    $ cd cpython/doc
    $ make update
    [lots of output stripped]
    $ make pydoc-topics
    mkdir -p build/pydoc-topics build/doctrees
    python tools/sphinx-build.py -b pydoc-topics -d build/doctrees -D latex_paper_size=  . build/pydoc-topics 
    Traceback (most recent call last):
      File "tools/sphinx-build.py", line 27, in <module>
        from sphinx import main
      File "/home/kousu/pro/cpython/Doc/tools/sphinx/__init__.py", line 44
        except ImportError, err:
                          ^
    SyntaxError: invalid syntax
    make: *** [build] Error 1

    I edited the Makefile to say PYTHON = python2
    and then it worked. Is the assumption that python2 is still supposed to be the default python everywhere? Is python 3 not able to build itself yet?

    [kousu@galleon Doc]$ pacman -Qi python
    Name : python
    Version : 3.3.2-2
    Description : Next generation of the python high-level scripting language
    Architecture : x86_64
    URL : http://www.python.org/
    Licenses : custom
    Groups : None
    Provides : python3
    Depends On : expat bzip2 gdbm openssl libffi zlib
    Optional Deps : tk: for tkinter [installed]
    sqlite [installed]
    Required By : cython ipython ktoblzcheck libreoffice-common python-cairo python-dateutil python-dbus python-markupsafe
    python-numpy python-pyparsing python-pytz python-pyzmq python-setuptools python-sip python-six python-sympy
    python-tornado python-xdg ranger youtube-dl
    Optional For : systemd
    Conflicts With : None
    Replaces : python3
    Installed Size : 86980.00 KiB
    Packager : Bart
    Build Date : Fri Sep 6 03:31:57 2013
    Install Date : Tue Sep 17 10:29:36 2013
    Install Reason : Installed as a dependency for another package
    Install Script : No
    Validated By : Signature

    @kousu kousu mannequin assigned docspython Oct 13, 2013
    @kousu kousu mannequin added the docs Documentation in the Doc dir label Oct 13, 2013
    @ezio-melotti
    Copy link
    Member

    This is a duplicate of bpo-10224.

    @ezio-melotti ezio-melotti added the type-feature A feature request or enhancement label Oct 13, 2013
    @kousu
    Copy link
    Mannequin Author

    kousu mannequin commented Oct 13, 2013

    I see that in Doc/tools/sphinx-build.py there is this check:

        if sys.version_info[:3] < (2, 4, 0):
            sys.stderr.write("""\
    Error: Sphinx needs to be executed with Python 2.4 or newer (not 3.0 though).
    (If you run this from the Makefile, you can set the PYTHON variable
    to the path of an alternative interpreter executable, e.g.,
    ``make html PYTHON=python2.5``).
    """)

    But I never saw this and had to debug it myself. I submit the attached patch as a solution.

    @kousu kousu mannequin reopened this Oct 13, 2013
    @kousu kousu mannequin removed the type-feature A feature request or enhancement label Oct 13, 2013
    @birkenfeld
    Copy link
    Member

    Looks ok for now.

    @python-dev
    Copy link
    Mannequin

    python-dev mannequin commented Oct 13, 2013

    New changeset 6e65ee2a0073 by Georg Brandl in branch '3.3':
    Closes bpo-19248: actually check for Python 3.x in tools/sphinx-build.py.
    http://hg.python.org/cpython/rev/6e65ee2a0073

    @python-dev python-dev mannequin closed this as completed Oct 13, 2013
    @Arfrever
    Copy link
    Mannequin

    Arfrever mannequin commented Oct 13, 2013

    Is the assumption that python2 is still supposed to be the default python everywhere?
    Is python 3 not able to build itself yet?

    You can manually install Sphinx >=1.1 (preferably >=1.2.*) (and its dependencies) using Python 3, and directly call sphinx-build from so installed Sphinx, instead of using make.

    @ezio-melotti ezio-melotti transferred this issue from another repository Apr 10, 2022
    Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
    Labels
    docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    2 participants