This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

classification
Title: sphinx is not py3k compatible
Type: Stage: resolved
Components: Documentation Versions: Python 3.1, Python 3.2, Python 3.3, Python 3.4, Python 3.5
process
Status: closed Resolution: fixed
Dependencies: Superseder: Build 3.x documentation using python3.x
View: 10224
Assigned To: docs@python Nosy List: Arfrever, docs@python, ezio.melotti, georg.brandl, kousu, python-dev
Priority: normal Keywords: patch

Created on 2013-10-13 19:09 by kousu, last changed 2022-04-11 14:57 by admin. This issue is now closed.

Files
File name Uploaded Description Edit
sphinx_version_check.patch kousu, 2013-10-13 19:19 review
Messages (6)
msg199764 - (view) Author: Nick Guenther (kousu) Date: 2013-10-13 19:09
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
msg199765 - (view) Author: Ezio Melotti (ezio.melotti) * (Python committer) Date: 2013-10-13 19:11
This is a duplicate of #10224.
msg199766 - (view) Author: Nick Guenther (kousu) Date: 2013-10-13 19:19
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.
msg199767 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2013-10-13 19:22
Looks ok for now.
msg199791 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2013-10-13 20:19
New changeset 6e65ee2a0073 by Georg Brandl in branch '3.3':
Closes #19248: actually check for Python 3.x in tools/sphinx-build.py.
http://hg.python.org/cpython/rev/6e65ee2a0073
msg199796 - (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) * (Python triager) Date: 2013-10-13 20:42
> 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`.
History
Date User Action Args
2022-04-11 14:57:51adminsetgithub: 63447
2013-10-13 20:42:23Arfreversetnosy: + Arfrever
messages: + msg199796
2013-10-13 20:19:42python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg199791

resolution: fixed
2013-10-13 19:22:29georg.brandlsetnosy: + georg.brandl
messages: + msg199767
2013-10-13 19:19:33koususetstatus: closed -> open
files: + sphinx_version_check.patch
type: enhancement ->
messages: + msg199766

keywords: + patch
resolution: duplicate -> (no value)
2013-10-13 19:11:21ezio.melottisetstatus: open -> closed

superseder: Build 3.x documentation using python3.x
nosy: + ezio.melotti

messages: + msg199765
type: enhancement
resolution: duplicate
stage: resolved
2013-10-13 19:09:31kousucreate