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

make doctest (Sphinx) emits a lot of warnings #79474

Closed
vstinner opened this issue Nov 21, 2018 · 16 comments
Closed

make doctest (Sphinx) emits a lot of warnings #79474

vstinner opened this issue Nov 21, 2018 · 16 comments
Assignees
Labels
3.8 only security fixes 3.9 only security fixes 3.10 only security fixes build The build process and cross-build docs Documentation in the Doc dir

Comments

@vstinner
Copy link
Member

BPO 35293
Nosy @vstinner, @ambv, @matrixise, @JulienPalard, @corona10, @miss-islington, @tirkarthi
PRs
  • bpo-35293: Remove RemovedInSphinx40Warning #22198
  • [3.9] bpo-35293: Remove RemovedInSphinx40Warning (GH-22198) #22302
  • [3.8] bpo-35293: Remove RemovedInSphinx40Warning (GH-22198) #22303
  • bpo-35293: Use sphinx 3.2.1 #22305
  • bpo-35293: Travis CI uses Sphinx 3.2.1 #22306
  • bpo-35293: Travis CI uses "make venv" for the doc #22307
  • [3.9] bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) #22309
  • [3.8] bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309) #22310
  • 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 = 'https://github.com/corona10'
    closed_at = <Date 2020-09-18.15:37:22.716>
    created_at = <Date 2018-11-21.21:27:11.215>
    labels = ['build', '3.8', '3.9', '3.10', 'docs']
    title = 'make doctest (Sphinx) emits a lot of warnings'
    updated_at = <Date 2020-10-05.16:10:19.402>
    user = 'https://github.com/vstinner'

    bugs.python.org fields:

    activity = <Date 2020-10-05.16:10:19.402>
    actor = 'lukasz.langa'
    assignee = 'corona10'
    closed = True
    closed_date = <Date 2020-09-18.15:37:22.716>
    closer = 'vstinner'
    components = ['Build', 'Documentation']
    creation = <Date 2018-11-21.21:27:11.215>
    creator = 'vstinner'
    dependencies = []
    files = []
    hgrepos = []
    issue_num = 35293
    keywords = ['patch']
    message_count = 16.0
    messages = ['330217', '330233', '330235', '330236', '345259', '355301', '363278', '377099', '377100', '377102', '377105', '377118', '377123', '377126', '377127', '378046']
    nosy_count = 7.0
    nosy_names = ['vstinner', 'lukasz.langa', 'matrixise', 'mdk', 'corona10', 'miss-islington', 'xtreak']
    pr_nums = ['22198', '22302', '22303', '22305', '22306', '22307', '22309', '22310']
    priority = 'normal'
    resolution = 'fixed'
    stage = 'resolved'
    status = 'closed'
    superseder = None
    type = None
    url = 'https://bugs.python.org/issue35293'
    versions = ['Python 3.8', 'Python 3.9', 'Python 3.10']

    @vstinner
    Copy link
    Member Author

    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.

    @vstinner vstinner added 3.8 only security fixes build The build process and cross-build labels Nov 21, 2018
    @tirkarthi
    Copy link
    Member

    They are warnings related to third party packages used for doctest and some of them might become incompatible with #10596. Related discussion : bpo-35109

    @vstinner
    Copy link
    Member Author

    They are warnings related to third party packages used for doctest and some of them might become incompatible with #10596. Related discussion : bpo-35109

    We should help these packages to be fixed :-)

    @corona10
    Copy link
    Member

    Looks like they already fixed it.

    We should wait their release :)

    @gvanrossum
    Copy link
    Member

    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")

    @gvanrossum gvanrossum removed the 3.8 only security fixes label Jun 11, 2019
    @tirkarthi
    Copy link
    Member

    Relevant docutils upstream issue : https://sourceforge.net/p/docutils/bugs/373/ . Also the SyntaxWarning was changed to DeprecationWarning with msg349335.

    @vstinner
    Copy link
    Member Author

    vstinner commented Mar 3, 2020

    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.

    @corona10
    Copy link
    Member

    New changeset 6595cb0 by Dong-hee Na in branch 'master':
    bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
    6595cb0

    @miss-islington
    Copy link
    Contributor

    New changeset b7cdea8 by Miss Islington (bot) in branch '3.8':
    bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
    b7cdea8

    @miss-islington
    Copy link
    Contributor

    New changeset f3e0ece by Miss Islington (bot) in branch '3.9':
    bpo-35293: Remove RemovedInSphinx40Warning (GH-22198)
    f3e0ece

    @corona10
    Copy link
    Member

    /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.

    @corona10 corona10 self-assigned this Sep 18, 2020
    @vstinner
    Copy link
    Member Author

    New changeset 8394500 by Victor Stinner in branch 'master':
    bpo-35293: Travis CI uses "make venv" for the doc (GH-22307)
    8394500

    @vstinner
    Copy link
    Member Author

    New changeset 9e73cac by Victor Stinner in branch '3.9':
    bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309)
    9e73cac

    @vstinner
    Copy link
    Member Author

    New changeset 3acc403 by Victor Stinner in branch '3.8':
    bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309) (GH-22310)
    3acc403

    @vstinner
    Copy link
    Member Author

    Building the documentation of Python 3.8, 3.9 and 3.10 don't produce warnings anymore, I close the issue.

    I created python/docsbuild-scripts#95 "Update Sphinx to 2.4.4".

    @vstinner vstinner added docs Documentation in the Doc dir 3.8 only security fixes 3.9 only security fixes 3.10 only security fixes labels Sep 18, 2020
    @ambv
    Copy link
    Contributor

    ambv commented Oct 5, 2020

    New changeset f8b3c64 by Łukasz Langa (Victor Stinner) in branch '3.9':
    bpo-35293: Travis CI uses "make venv" for the doc (GH-22307) (GH-22309)
    f8b3c64

    @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
    3.8 only security fixes 3.9 only security fixes 3.10 only security fixes build The build process and cross-build docs Documentation in the Doc dir
    Projects
    None yet
    Development

    No branches or pull requests

    6 participants