From e5e6bc68f9c9aa127ea7ae390b1a0a7005b5d805 Mon Sep 17 00:00:00 2001 From: Georg Brandl Date: Wed, 6 Oct 2010 10:43:34 +0000 Subject: [PATCH] Merged revisions 85276 via svnmerge from svn+ssh://svn.python.org/python/branches/py3k ........ r85276 | georg.brandl | 2010-10-06 12:35:24 +0200 (Mi, 06 Okt 2010) | 1 line Fix the suspicious builder not to write CRLF, update suspicious file and add instructions to Makefile. ........ --- Doc/Makefile | 11 +- Doc/library/functions.rst | 2 +- Doc/tools/sphinxext/susp-ignored.csv | 146 +++++++++++++++++++++++++++ Doc/tools/sphinxext/suspicious.py | 50 +++++---- 4 files changed, 181 insertions(+), 28 deletions(-) diff --git a/Doc/Makefile b/Doc/Makefile index 5c39d8bdf0b..8fcf5385730 100644 --- a/Doc/Makefile +++ b/Doc/Makefile @@ -86,13 +86,14 @@ changes: build linkcheck: BUILDER = linkcheck linkcheck: build - @echo "Link check complete; look for any errors in the above output " \ + @echo "Link check complete; look for any errors in the above output" \ "or in build/$(BUILDER)/output.txt" suspicious: BUILDER = suspicious suspicious: build - @echo "Suspicious check complete; look for any errors in the above output " \ - "or in build/$(BUILDER)/suspicious.txt" + @echo "Suspicious check complete; look for any errors in the above output" \ + "or in build/$(BUILDER)/suspicious.csv. If all issues are false" \ + "positives, append that file to tools/sphinxext/susp-ignored.csv." coverage: BUILDER = coverage coverage: build @@ -100,12 +101,12 @@ coverage: build doctest: BUILDER = doctest doctest: build - @echo "Testing of doctests in the sources finished, look at the " \ + @echo "Testing of doctests in the sources finished, look at the" \ "results in build/doctest/output.txt" pydoc-topics: BUILDER = pydoc-topics pydoc-topics: build - @echo "Building finished; now copy build/pydoc-topics/topics.py " \ + @echo "Building finished; now copy build/pydoc-topics/topics.py" \ "to Lib/pydoc_data/topics.py" htmlview: html diff --git a/Doc/library/functions.rst b/Doc/library/functions.rst index c1a576ca01e..efcac085af3 100644 --- a/Doc/library/functions.rst +++ b/Doc/library/functions.rst @@ -142,7 +142,7 @@ are always available. They are listed here in alphabetical order. .. function:: compile(source, filename, mode, flags=0, dont_inherit=False) Compile the *source* into a code or AST object. Code objects can be executed - by:func:`exec` or :func:`eval`. *source* can either be a string or an AST + by :func:`exec` or :func:`eval`. *source* can either be a string or an AST object. Refer to the :mod:`ast` module documentation for information on how to work with AST objects. diff --git a/Doc/tools/sphinxext/susp-ignored.csv b/Doc/tools/sphinxext/susp-ignored.csv index 3f987c7647b..dffd32c3530 100644 --- a/Doc/tools/sphinxext/susp-ignored.csv +++ b/Doc/tools/sphinxext/susp-ignored.csv @@ -164,3 +164,149 @@ whatsnew/2.4,,:System, whatsnew/2.5,,:memory,:memory: whatsnew/2.5,,:step,[start:stop:step] whatsnew/2.5,,:stop,[start:stop:step] +distutils/examples,267,`,This is the description of the ``foobar`` package. +documenting/fromlatex,39,:func,:func:`str(object)` +documenting/fromlatex,39,`,:func:`str(object)` +documenting/fromlatex,39,`,``str(object)`` +documenting/fromlatex,55,.. deprecated:,.. deprecated:: 2.5 +documenting/fromlatex,66,.. note:,.. note:: +documenting/fromlatex,76,:samp,":samp:`open({filename}, {mode})`" +documenting/fromlatex,76,`,":samp:`open({filename}, {mode})`" +documenting/fromlatex,80,`,``'c'`` +documenting/fromlatex,80,`,`Title `_ +documenting/fromlatex,80,`,``code`` +documenting/fromlatex,80,`,`Title `_ +documenting/fromlatex,99,:file,:file:`C:\\Temp\\my.tmp` +documenting/fromlatex,99,`,:file:`C:\\Temp\\my.tmp` +documenting/fromlatex,99,`,"``open(""C:\Temp\my.tmp"")``" +documenting/fromlatex,129,.. function:,.. function:: do_foo(bar) +documenting/fromlatex,141,.. function:,".. function:: open(filename[, mode[, buffering]])" +documenting/fromlatex,152,.. function:,.. function:: foo_* +documenting/fromlatex,152,:noindex,:noindex: +documenting/fromlatex,162,.. describe:,.. describe:: a == b +documenting/fromlatex,168,.. cmdoption:,.. cmdoption:: -O +documenting/fromlatex,168,.. envvar:,.. envvar:: PYTHONINSPECT +documenting/rest,33,`,``text`` +documenting/rest,47,:rolename,:rolename:`content` +documenting/rest,47,`,:rolename:`content` +documenting/rest,103,::,This is a normal text paragraph. The next paragraph is a code sample:: +documenting/rest,130,`,`Link text `_ +documenting/rest,187,.. function:,.. function:: foo(x) +documenting/rest,187,:bar,:bar: no +documenting/rest,208,.. rubric:,.. rubric:: Footnotes +faq/programming,762,:reduce,"print((lambda Ru,Ro,Iu,Io,IM,Sx,Sy:reduce(lambda x,y:x+y,map(lambda y," +faq/programming,762,:reduce,"Sx=Sx,Sy=Sy:reduce(lambda x,y:x+y,map(lambda x,xc=Ru,yc=yc,Ru=Ru,Ro=Ro," +faq/programming,762,:chr,">=4.0) or 1+f(xc,yc,x*x-y*y+xc,2.0*x*y+yc,k-1,f):f(xc,yc,x,y,k,f):chr(" +faq/programming,1047,::,for x in sequence[::-1]: +faq/windows,229,:EOF,@setlocal enableextensions & python -x %~f0 %* & goto :EOF +faq/windows,393,:REG,.py :REG_SZ: c:\\python.exe -u %s %s +library/bisect,32,:hi,all(val >= x for val in a[i:hi]) +library/bisect,42,:hi,all(val > x for val in a[i:hi]) +library/http.client,52,:port,host:port +library/nntplib,272,:bytes,:bytes +library/nntplib,272,:lines,:lines +library/nntplib,272,:lines,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" +library/nntplib,272,:bytes,"['xref', 'from', ':lines', ':bytes', 'references', 'date', 'message-id', 'subject']" +library/pickle,567,:memory,"conn = sqlite3.connect("":memory:"")" +library/profile,293,:lineno,"(sort by filename:lineno)," +library/socket,261,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]" +library/stdtypes,1026,:end,s[start:end] +library/stdtypes,1195,:end,s[start:end] +library/urllib.request,64,:close,Connection:close +library/urllib.request,901,:password,"""joe:password@python.org""" +library/urllib.request,1064,:lang,"xmlns=""http://www.w3.org/1999/xhtml"" xml:lang=""en"" lang=""en"">\n\n\n" +library/xmlrpc.client,103,:pass,http://user:pass@host:port/path +library/xmlrpc.client,103,:port,http://user:pass@host:port/path +library/xmlrpc.client,103,:pass,user:pass +license,717,`,* THIS SOFTWARE IS PROVIDED BY THE OpenSSL PROJECT ``AS IS'' AND ANY +license,717,`,* THIS SOFTWARE IS PROVIDED BY ERIC YOUNG ``AS IS'' AND +license,879,`,"``Software''), to deal in the Software without restriction, including" +license,879,`,"THE SOFTWARE IS PROVIDED ``AS IS'', WITHOUT WARRANTY OF ANY KIND," +reference/lexical_analysis,704,`,$ ? ` +whatsnew/2.7,735,:Sunday,'2009:4:Sunday' +whatsnew/2.7,862,::,"export PYTHONWARNINGS=all,error:::Cookie:0" +whatsnew/2.7,862,:Cookie,"export PYTHONWARNINGS=all,error:::Cookie:0" +whatsnew/2.7,1619,::,>>> urlparse.urlparse('http://[1080::8:800:200C:417A]/foo') +whatsnew/2.7,1619,::,"ParseResult(scheme='http', netloc='[1080::8:800:200C:417A]'," +documenting/markup,33,.. sectionauthor:,.. sectionauthor:: Guido van Rossum +documenting/markup,42,:mod,:mod:`parrot` -- Dead parrot access +documenting/markup,42,`,:mod:`parrot` -- Dead parrot access +documenting/markup,42,.. module:,.. module:: parrot +documenting/markup,42,:platform,":platform: Unix, Windows" +documenting/markup,42,:synopsis,:synopsis: Analyze and reanimate dead parrots. +documenting/markup,42,.. moduleauthor:,.. moduleauthor:: Eric Cleese +documenting/markup,42,.. moduleauthor:,.. moduleauthor:: John Idle +documenting/markup,88,:noindex,:noindex: +documenting/markup,95,.. function:,.. function:: spam(eggs) +documenting/markup,95,:noindex,:noindex: +documenting/markup,101,.. method:,.. method:: FileInput.input(...) +documenting/markup,121,.. cfunction:,".. cfunction:: PyObject* PyType_GenericAlloc(PyTypeObject *type, Py_ssize_t nitems)" +documenting/markup,131,.. cmember:,.. cmember:: PyObject* PyTypeObject.tp_bases +documenting/markup,150,.. cvar:,.. cvar:: PyObject* PyClass_Type +documenting/markup,179,.. function:,".. function:: Timer.repeat([repeat=3[, number=1000000]])" +documenting/markup,209,.. cmdoption:,.. cmdoption:: -m +documenting/markup,227,.. describe:,.. describe:: opcode +documenting/markup,256,.. highlightlang:,.. highlightlang:: c +documenting/markup,276,.. literalinclude:,.. literalinclude:: example.py +documenting/markup,291,:rolename,:rolename:`content` +documenting/markup,291,`,:rolename:`content` +documenting/markup,296,:role,:role:`title ` +documenting/markup,296,`,:role:`title ` +documenting/markup,302,:meth,:meth:`~Queue.Queue.get` +documenting/markup,302,`,:meth:`~Queue.Queue.get` +documenting/markup,350,:func,:func:`filter` +documenting/markup,350,`,:func:`filter` +documenting/markup,350,:func,:func:`foo.filter` +documenting/markup,350,`,:func:`foo.filter` +documenting/markup,356,:func,:func:`open` +documenting/markup,356,`,:func:`open` +documenting/markup,356,:func,:func:`.open` +documenting/markup,356,`,:func:`.open` +documenting/markup,435,:file,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... +documenting/markup,435,`,... is installed in :file:`/usr/lib/python2.{x}/site-packages` ... +documenting/markup,454,:kbd,:kbd:`C-x C-f` +documenting/markup,454,`,:kbd:`C-x C-f` +documenting/markup,454,:kbd,:kbd:`Control-x Control-f` +documenting/markup,454,`,:kbd:`Control-x Control-f` +documenting/markup,468,:mailheader,:mailheader:`Content-Type` +documenting/markup,468,`,:mailheader:`Content-Type` +documenting/markup,477,:manpage,:manpage:`ls(1)` +documenting/markup,477,`,:manpage:`ls(1)` +documenting/markup,493,:menuselection,:menuselection:`Start --> Programs` +documenting/markup,493,`,:menuselection:`Start --> Programs` +documenting/markup,508,`,``code`` +documenting/markup,526,:file,:file: +documenting/markup,526,`,``code`` +documenting/markup,561,:ref,:ref:`label-name` +documenting/markup,561,`,:ref:`label-name` +documenting/markup,565,:ref,"It refers to the section itself, see :ref:`my-reference-label`." +documenting/markup,565,`,"It refers to the section itself, see :ref:`my-reference-label`." +documenting/markup,574,:ref,:ref: +documenting/markup,595,.. note:,.. note:: +documenting/markup,622,.. versionadded:,.. versionadded:: 3.1 +documenting/markup,647,::,.. impl-detail:: +documenting/markup,647,::,.. impl-detail:: This shortly mentions an implementation detail. +documenting/markup,667,.. seealso:,.. seealso:: +documenting/markup,667,:mod,Module :mod:`zipfile` +documenting/markup,667,`,Module :mod:`zipfile` +documenting/markup,667,:mod,Documentation of the :mod:`zipfile` standard module. +documenting/markup,667,`,Documentation of the :mod:`zipfile` standard module. +documenting/markup,667,`,"`GNU tar manual, Basic Tar Format `_" +documenting/markup,681,.. centered:,.. centered:: +documenting/markup,726,.. toctree:,.. toctree:: +documenting/markup,726,:maxdepth,:maxdepth: 2 +documenting/markup,742,.. index:,.. index:: +documenting/markup,772,.. index:,".. index:: BNF, grammar, syntax, notation" +documenting/markup,803,`,"unaryneg ::= ""-"" `integer`" +documenting/markup,808,.. productionlist:,.. productionlist:: +documenting/markup,808,`,"try1_stmt: ""try"" "":"" `suite`" +documenting/markup,808,`,": (""except"" [`expression` ["","" `target`]] "":"" `suite`)+" +documenting/markup,808,`,": [""else"" "":"" `suite`]" +documenting/markup,808,`,": [""finally"" "":"" `suite`]" +documenting/markup,808,`,"try2_stmt: ""try"" "":"" `suite`" +documenting/markup,808,`,": ""finally"" "":"" `suite`" +library/importlib,396,`,The keys are the module names -- packages must end in ``.__init__``. +library/importlib,396,`,"name with ``.__init__`` appended to it.""""""" +library/importlib,396,`,# ``__init__``. +library/socket,249,::,"(10, 1, 6, '', ('2001:888:2000:d::a2', 80, 0, 0))]" +library/stdtypes,860,:end,s[start:end] diff --git a/Doc/tools/sphinxext/suspicious.py b/Doc/tools/sphinxext/suspicious.py index ae11793ea54..f15e931b90a 100644 --- a/Doc/tools/sphinxext/suspicious.py +++ b/Doc/tools/sphinxext/suspicious.py @@ -41,9 +41,11 @@ Copyright 2009 Gabriel A. Genellina """ -import os, sys -import csv +import os import re +import csv +import sys + from docutils import nodes from sphinx.builders import Builder @@ -54,9 +56,10 @@ detect_all = re.compile(ur''' (?