classification
Title: make doctest (Sphinx) emits a lot of warnings
Type: Stage: resolved
Components: Build, Documentation Versions: Python 3.10, Python 3.9, Python 3.8
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: corona10 Nosy List: corona10, lukasz.langa, matrixise, mdk, miss-islington, vstinner, xtreak
Priority: normal Keywords: patch

Created on 2018-11-21 21:27 by vstinner, last changed 2020-10-05 16:10 by lukasz.langa. This issue is now closed.

Pull Requests
URL Status Linked Edit
PR 22198 merged corona10, 2020-09-11 11:42
PR 22302 merged miss-islington, 2020-09-18 09:22
PR 22303 merged miss-islington, 2020-09-18 09:22
PR 22305 closed corona10, 2020-09-18 13:08
PR 22306 closed vstinner, 2020-09-18 13:08
PR 22307 merged vstinner, 2020-09-18 13:16
PR 22309 merged vstinner, 2020-09-18 14:28
PR 22310 merged vstinner, 2020-09-18 14:58
Messages (16)
msg330217 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-21 21:27
The following commands emits a lot of warnings:

make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest
# adapt PYTHON to point to Python 3.8 compiled in debug mmode

Travis CI logs:

https://travis-ci.org/python/cpython/jobs/458140641

make: Entering directory `/home/travis/build/python/cpython/Doc'
../python -m venv ./venv
(...)
The venv has been created in the ./venv directory
make[1]: Entering directory `/home/travis/build/python/cpython/Doc'
mkdir -p build
Building NEWS from Misc/NEWS.d with blurb
PATH=./venv/bin:$PATH sphinx-build -b doctest -d build/doctrees -D latex_elements.papersize= -q -W -j4 -W . build/doctest 
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/babel/localedata.py:17: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableMapping
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/jinja2/runtime.py:318: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import Mapping
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/jinja2/sandbox.py:82: DeprecationWarning: Using or importing the ABCs from 'collections' instead of from 'collections.abc' is deprecated, and in 3.8 it will stop working
  from collections import MutableSet, MutableMapping, MutableSequence
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/environment/__init__.py:340: RemovedInSphinx30Warning: env.versionchanges() is deprecated. Please use ChangeSetDomain instead.
  for version, changes in other.versionchanges.items():
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/sphinx/environment/__init__.py:341: RemovedInSphinx30Warning: env.versionchanges() is deprecated. Please use ChangeSetDomain instead.
  self.versionchanges.setdefault(version, []).extend(
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/venv/lib/python3.8/site-packages/docutils/parsers/rst/states.py:2130: RemovedInSphinx40Warning: highlightlang directive is deprecated. Please use highlight directive instead.
  result = directive_instance.run()
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
/home/travis/build/python/cpython/Doc/tools/extensions/pyspecific.py:274: RemovedInSphinx30Warning: env.note_versionchange() is deprecated. Please use ChangeSetDomain.note_changeset() instead.
  env.note_versionchange('deprecated', version[0], node, self.lineno)
<doctest default[2]>:1: DeprecationWarning: `formatargspec` is deprecated since Python 3.5. Use `signature` and the `Signature` object directly
  formatargspec(*getfullargspec(f))
<doctest default[0]>:1: DeprecationWarning: the imp module is deprecated in favour of importlib; see the module's documentation for alternative uses
  import imp
obj dead or exiting
/home/travis/build/python/cpython/Lib/socket.py:660: ResourceWarning: unclosed <socket.socket fd=9, family=AddressFamily.AF_INET, type=SocketKind.SOCK_STREAM, proto=6, laddr=('172.17.0.8', 40136), raddr=('195.159.176.226', 119)>
  self._sock = None
ResourceWarning: Enable tracemalloc to get the object allocation traceback
make[1]: Leaving directory `/home/travis/build/python/cpython/Doc'
make: Leaving directory `/home/travis/build/python/cpython/Doc'

The command "if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  XVFB_RUN=xvfb-run;
fi

$XVFB_RUN make buildbottest TESTOPTS="-j4 -uall,-cpu"
if [[ "$TRAVIS_OS_NAME" == "linux" ]]; then
  $XVFB_RUN make PYTHON=../python SPHINXOPTS="-q -W -j4" -C Doc/ venv doctest
fi
" exited with 0.
msg330233 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2018-11-22 07:51
They are warnings related to third party packages used for doctest and some of them might become incompatible with https://github.com/python/cpython/pull/10596. Related discussion : issue35109
msg330235 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2018-11-22 08:00
> They are warnings related to third party packages used for doctest and some of them might become incompatible with https://github.com/python/cpython/pull/10596. Related discussion : issue35109

We should help these packages to be fixed :-)
msg330236 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2018-11-22 08:37
Looks like they already fixed it.

- jinja2: https://github.com/pallets/jinja/commit/31bf9b7e71c3fee3b7866ffdc0f70f4525a490d9
- babel: https://github.com/python-babel/babel/commit/65d6bf39f2a2b4bbbbc02cd1e00c44ce9d7c1c5b

We should wait their release :)
msg345259 - (view) Author: Guido van Rossum (gvanrossum) * (Python committer) Date: 2019-06-11 18:15
I still get some warnings about docutils itself, e.g.

/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/_html_base.py:1035: SyntaxWarning: invalid escape sequence \(
  'mathjax': ('\(%s\)', '\\begin{%s}\n%s\n\\end{%s}'),
/Users/guido/v38/lib/python3.8/site-packages/docutils/utils/math/math2html.py:4103: SyntaxWarning: invalid escape sequence \{
  """Check for an empty command: look for command disguised as ending.
/Users/guido/v38/lib/python3.8/site-packages/docutils/utils/math/math2html.py:4563: SyntaxWarning: invalid escape sequence \e
  "A \\begin{}...\end command and what it entails (array, cases, aligned)"
/Users/guido/v38/lib/python3.8/site-packages/docutils/utils/math/latex2mathml.py:154: SyntaxWarning: invalid escape sequence \i
  '\in': '\u2209',
/Users/guido/v38/lib/python3.8/site-packages/docutils/utils/math/latex2mathml.py:155: SyntaxWarning: invalid escape sequence \e
  '\equiv': '\u2262'}
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:1197: SyntaxWarning: invalid escape sequence \w
  none ) = re.split('(\w+)(.*)', settings.literal_block_env)
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:1463: SyntaxWarning: invalid escape sequence \ 
  """Return text with 'problematic' characters escaped.
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:1562: SyntaxWarning: invalid escape sequence \p
  """Return list of label definitions for all ids of `node`
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:1922: SyntaxWarning: invalid escape sequence \p
  self.title.insert(0, '\phantomsection%\n  ')
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:2269: SyntaxWarning: invalid escape sequence \d
  match = re.match('(\d*\.?\d*)\s*(\S*)', length_str)
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:2381: SyntaxWarning: invalid escape sequence \i
  self.out.append('\item[] ')
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:2525: SyntaxWarning: invalid escape sequence \(
  wrapper = '\(%s\)'
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:2804: SyntaxWarning: invalid escape sequence \c
  self.out.append('\n\n{\color{red}%s/%s} in \\texttt{%s}%s\n' %
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/latex2e/__init__.py:2892: SyntaxWarning: invalid escape sequence \l
  self.out.append('}] \leavevmode ')
/Users/guido/v38/lib/python3.8/site-packages/docutils/writers/manpage.py:371: SyntaxWarning: invalid escape sequence \-
  "%(title)s \- %(subtitle)s\n")
msg355301 - (view) Author: Karthikeyan Singaravelan (xtreak) * (Python committer) Date: 2019-10-24 08:37
Relevant docutils upstream issue : https://sourceforge.net/p/docutils/bugs/373/ . Also the SyntaxWarning was changed to DeprecationWarning with msg349335.
msg363278 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-03-03 16:56
> Relevant docutils upstream issue : https://sourceforge.net/p/docutils/bugs/373/ . Also the SyntaxWarning was changed to DeprecationWarning with msg349335.

SyntaxWarning warnings have been fixed in docutils 0.16.
msg377099 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-09-18 09:22
New changeset 6595cb0af4c51c0381c233b97884fe916a4ddd35 by Dong-hee Na in branch 'master':
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
https://github.com/python/cpython/commit/6595cb0af4c51c0381c233b97884fe916a4ddd35
msg377100 - (view) Author: miss-islington (miss-islington) Date: 2020-09-18 09:31
New changeset b7cdea8f087699aaa6486ce5a4f6e5a143dc355e by Miss Islington (bot) in branch '3.8':
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
https://github.com/python/cpython/commit/b7cdea8f087699aaa6486ce5a4f6e5a143dc355e
msg377102 - (view) Author: miss-islington (miss-islington) Date: 2020-09-18 09:38
New changeset f3e0eceff6207d5072befeef0e1ec195c3e2b0ab by Miss Islington (bot) in branch '3.9':
bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
https://github.com/python/cpython/commit/f3e0eceff6207d5072befeef0e1ec195c3e2b0ab
msg377105 - (view) Author: Dong-hee Na (corona10) * (Python committer) Date: 2020-09-18 11:05
/home/travis/virtualenv/python3.6.10/lib/python3.6/site-packages/sphinx/util/nodes.py:151: FutureWarning: 

   The iterable returned by Node.traverse()

https://travis-ci.com/github/python/cpython/jobs/386971271

The issue is still left, I am going to investigate this issue.
msg377118 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-18 14:23
New changeset 8394500cca56490cc347604d39ca40abcdce46c3 by Victor Stinner in branch 'master':
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307)
https://github.com/python/cpython/commit/8394500cca56490cc347604d39ca40abcdce46c3
msg377123 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-18 14:53
New changeset 9e73cac173e5e9010bd18c8334fffeee1cade3a4 by Victor Stinner in branch '3.9':
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309)
https://github.com/python/cpython/commit/9e73cac173e5e9010bd18c8334fffeee1cade3a4
msg377126 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-18 15:21
New changeset 3acc403f21642f1e916f035abf24c3fb81495b3c by Victor Stinner in branch '3.8':
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309) (GH-22310)
https://github.com/python/cpython/commit/3acc403f21642f1e916f035abf24c3fb81495b3c
msg377127 - (view) Author: STINNER Victor (vstinner) * (Python committer) Date: 2020-09-18 15:37
Building the documentation of Python 3.8, 3.9 and 3.10 don't produce warnings anymore, I close the issue.

I created https://github.com/python/docsbuild-scripts/issues/95 "Update Sphinx to 2.4.4".
msg378046 - (view) Author: Łukasz Langa (lukasz.langa) * (Python committer) Date: 2020-10-05 16:10
New changeset f8b3c64958753abce7badbff3525863577fe2e04 by Łukasz Langa (Victor Stinner) in branch '3.9':
bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309)
https://github.com/python/cpython/commit/f8b3c64958753abce7badbff3525863577fe2e04
History
Date User Action Args
2020-10-05 16:10:19lukasz.langasetnosy: + lukasz.langa
messages: + msg378046
2020-09-18 15:37:22vstinnersetstatus: open -> closed
versions: + Python 3.8, Python 3.9, Python 3.10
messages: + msg377127

components: + Documentation
resolution: fixed
stage: patch review -> resolved
2020-09-18 15:21:33vstinnersetmessages: + msg377126
2020-09-18 15:07:41gvanrossumsetnosy: - gvanrossum
2020-09-18 14:58:45vstinnersetpull_requests: + pull_request21358
2020-09-18 14:53:50vstinnersetmessages: + msg377123
2020-09-18 14:28:03vstinnersetpull_requests: + pull_request21357
2020-09-18 14:23:22vstinnersetmessages: + msg377118
2020-09-18 13:16:26vstinnersetpull_requests: + pull_request21355
2020-09-18 13:08:47vstinnersetpull_requests: + pull_request21354
2020-09-18 13:08:36corona10setpull_requests: + pull_request21353
2020-09-18 12:05:05corona10setassignee: corona10
2020-09-18 11:05:45corona10setmessages: + msg377105
2020-09-18 09:38:46miss-islingtonsetmessages: + msg377102
2020-09-18 09:31:37miss-islingtonsetmessages: + msg377100
2020-09-18 09:22:59miss-islingtonsetpull_requests: + pull_request21352
2020-09-18 09:22:51miss-islingtonsetnosy: + miss-islington
pull_requests: + pull_request21351
2020-09-18 09:22:44corona10setmessages: + msg377099
2020-09-11 11:42:37corona10setkeywords: + patch
stage: patch review
pull_requests: + pull_request21257
2020-03-03 16:56:03vstinnersetmessages: + msg363278
2019-10-24 08:37:37xtreaksetmessages: + msg355301
2019-06-11 18:15:07gvanrossumsetnosy: + gvanrossum

messages: + msg345259
versions: - Python 3.8
2018-11-22 08:37:27corona10setnosy: + corona10
messages: + msg330236
2018-11-22 08:00:33vstinnersetmessages: + msg330235
2018-11-22 07:51:16xtreaksetnosy: + xtreak
messages: + msg330233
2018-11-21 21:27:21vstinnersetnosy: + matrixise, mdk
2018-11-21 21:27:11vstinnercreate