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.

Title: Failure building 2.7 docs on Windows
Type: behavior Stage: resolved
Components: Devguide, Documentation Versions: Python 2.7
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: docs@python Nosy List: docs@python, ezio.melotti, georg.brandl, ned.deily, python-dev, terry.reedy
Priority: normal Keywords:

Created on 2014-10-02 03:09 by terry.reedy, last changed 2022-04-11 14:58 by admin. This issue is now closed.

Messages (5)
msg228152 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-10-02 03:09
I was able to build docs of all versions with the old system.  When 3.4 was changed to the new system, 'pip install sphinx' installed everything needed so that 'sphinx-build -bhtml . build/html'  in .../Doc (Devguide 7.5.2) works for 3.4 (and 3.5).  "PYTHON=C:\programs\python27\python.exe" does not seem to matter.

After the recent conversion for 2.7, that command and 'make html' (devguide 7.5.1) do not work for 2.7. The devguide instructions are version-independent, but the reality does not seem to be.  Both commands give this.

Running Sphinx v1.2.2

Configuration error:
There is a syntax error in your configuration file: invalid syntax (, line 71)
Did you change the syntax from 2.x to 3.x?

tools/ line 71, is "print x'.  When I added ()s, this error goes away and I get

Running Sphinx v1.2.2

Exception occurred:
  File "F:\Python\dev\2\py27\Doc\tools\", line 247, in <module>
    import suspicious
  File "F:\Python\dev\2\py27\Doc\tools\", line 57
    detect_all = re.compile(ur'''
    ::(?=[^=])|            # two :: (but NOT ::=)
    :[a-zA-Z][a-zA-Z0-9]+| # :foo
    `|                     # ` (seldom used by itself)
    (?<!\.)\.\.[ \t]*\w+:  # .. foo: (but NOT ... else:)
    ''', re.UNICODE | re.VERBOSE).finditer

SyntaxError: invalid syntax

I expect the problem is the 'ur' prefix, invalid in 3.4+.

I tried to install a 2.7 version of sphinx, but pip refuses.

C:\Programs\Python27>pip install sphinx
Requirement already satisfied (use --upgrade to upgrade): sphinx in c:\programs\python34\lib\site-packages

So I don't know how to sensibly proceed without disabling 3.x builds.
msg228154 - (view) Author: Ned Deily (ned.deily) * (Python committer) Date: 2014-10-02 03:34
Your analysis is correct: you now do need to use a 2.7 sphinx to build 2.7 docs.  It looks like you may be using a 3.4 version of pip.  However you invoke python2.7, try "python -m pip install sphinx".
msg228160 - (view) Author: Georg Brandl (georg.brandl) * (Python committer) Date: 2014-10-02 06:07
> you now do need

You always did :)

However, it should not be a problem to make the extensions 2.x and 3.x compatible in both branches.
msg228161 - (view) Author: Roundup Robot (python-dev) (Python triager) Date: 2014-10-02 06:27
New changeset fd2530294d50 by Georg Brandl in branch '2.7':
Closes #22537: Make sphinx extensions compatible with Python 2 or 3, like in the 3.x branches
msg228237 - (view) Author: Terry J. Reedy (terry.reedy) * (Python committer) Date: 2014-10-02 16:24
Works great. Thanks.
Date User Action Args
2022-04-11 14:58:08adminsetgithub: 66727
2014-10-02 16:24:54terry.reedysetmessages: + msg228237
2014-10-02 06:27:25python-devsetstatus: open -> closed

nosy: + python-dev
messages: + msg228161

resolution: fixed
stage: needs patch -> resolved
2014-10-02 06:07:57georg.brandlsetmessages: + msg228160
2014-10-02 03:34:34ned.deilysetnosy: + ned.deily
messages: + msg228154
2014-10-02 03:09:34terry.reedycreate