[Python-checkins] r68427 - in python/branches/py3k: Doc/Makefile Doc/library/ctypes.rst Doc/library/ftplib.rst Doc/library/multiprocessing.rst Doc/library/stdtypes.rst Doc/make.bat Doc/tools Doc/tools/rstlint.py Doc/tools/sphinxext/pyspecific.py Doc/tools/sphinxext/susp-ignored.csv Doc/tools/sphinxext/suspicious.py Doc/whatsnew/2.6.rst Lib/lib2to3/fixes/fix_imports.py Lib/lib2to3/fixes/fix_imports2.py Lib/lib2to3/fixes/fix_urllib.py Lib/lib2to3/pgen2/driver.py Misc/build.sh
benjamin.peterson
python-checkins at python.org
Fri Jan 9 04:03:23 CET 2009
Author: benjamin.peterson
Date: Fri Jan 9 04:03:23 2009
New Revision: 68427
Log:
Merged revisions 68288-68291,68325-68326,68338,68388,68393,68423 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
................
r68288 | benjamin.peterson | 2009-01-03 18:39:07 -0600 (Sat, 03 Jan 2009) | 1 line
only check the actual compile() call for a SyntaxError
................
r68289 | georg.brandl | 2009-01-04 02:26:10 -0600 (Sun, 04 Jan 2009) | 2 lines
Test commit.
................
r68290 | georg.brandl | 2009-01-04 04:23:49 -0600 (Sun, 04 Jan 2009) | 4 lines
Add "suspicious" builder which finds leftover markup in the HTML files.
Patch by Gabriel Genellina.
................
r68291 | georg.brandl | 2009-01-04 04:24:09 -0600 (Sun, 04 Jan 2009) | 2 lines
Fix two issues found by the suspicious builder.
................
r68325 | benjamin.peterson | 2009-01-04 16:00:18 -0600 (Sun, 04 Jan 2009) | 1 line
use Jinja 2.1.1
................
r68326 | georg.brandl | 2009-01-04 16:03:10 -0600 (Sun, 04 Jan 2009) | 2 lines
Update make.bat.
................
r68338 | neal.norwitz | 2009-01-04 21:57:25 -0600 (Sun, 04 Jan 2009) | 1 line
Make sure to checkout any new packages
................
r68388 | benjamin.peterson | 2009-01-07 21:39:46 -0600 (Wed, 07 Jan 2009) | 1 line
string exceptions are gone
................
r68393 | benjamin.peterson | 2009-01-07 22:01:00 -0600 (Wed, 07 Jan 2009) | 1 line
use new sphinx modules
................
r68423 | benjamin.peterson | 2009-01-08 20:13:34 -0600 (Thu, 08 Jan 2009) | 29 lines
Merged revisions 68306-68308,68340,68368,68422 via svnmerge from
svn+ssh://pythondev@svn.python.org/sandbox/trunk/2to3/lib2to3
........
r68306 | benjamin.peterson | 2009-01-04 12:27:19 -0600 (Sun, 04 Jan 2009) | 1 line
fix_urllib: add mappings for the url parsing functions
........
r68307 | benjamin.peterson | 2009-01-04 12:30:01 -0600 (Sun, 04 Jan 2009) | 1 line
remove duplicated function
........
r68308 | benjamin.peterson | 2009-01-04 12:50:34 -0600 (Sun, 04 Jan 2009) | 1 line
turtle is no longer renamed
........
r68340 | georg.brandl | 2009-01-05 02:11:39 -0600 (Mon, 05 Jan 2009) | 2 lines
Fix undefined locals in parse_tokens().
........
r68368 | benjamin.peterson | 2009-01-06 17:56:10 -0600 (Tue, 06 Jan 2009) | 1 line
fix typo (thanks to Robert Lehmann)
........
r68422 | benjamin.peterson | 2009-01-08 20:01:03 -0600 (Thu, 08 Jan 2009) | 1 line
run the imports fixers after fix_import, so fix_import doesn't try to make stdlib renames into relative imports #4876
........
................
Added:
python/branches/py3k/Doc/tools/sphinxext/susp-ignored.csv
- copied unchanged from r68291, /python/trunk/Doc/tools/sphinxext/susp-ignored.csv
python/branches/py3k/Doc/tools/sphinxext/suspicious.py
- copied, changed from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py
Modified:
python/branches/py3k/ (props changed)
python/branches/py3k/Doc/Makefile
python/branches/py3k/Doc/library/ctypes.rst
python/branches/py3k/Doc/library/ftplib.rst
python/branches/py3k/Doc/library/multiprocessing.rst
python/branches/py3k/Doc/library/stdtypes.rst
python/branches/py3k/Doc/make.bat
python/branches/py3k/Doc/tools/ (props changed)
python/branches/py3k/Doc/tools/rstlint.py
python/branches/py3k/Doc/tools/sphinxext/pyspecific.py
python/branches/py3k/Doc/whatsnew/2.6.rst
python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py
python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py
python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py
python/branches/py3k/Lib/lib2to3/pgen2/driver.py
python/branches/py3k/Misc/build.sh
Modified: python/branches/py3k/Doc/Makefile
==============================================================================
--- python/branches/py3k/Doc/Makefile (original)
+++ python/branches/py3k/Doc/Makefile Fri Jan 9 04:03:23 2009
@@ -24,6 +24,7 @@
@echo " text to make plain text files"
@echo " changes to make an overview over all changed/added/deprecated items"
@echo " linkcheck to check all external links for integrity"
+ @echo " suspicious to check for suspicious markup in output text"
@echo " coverage to check documentation coverage for library and C API"
@echo " dist to create a \"dist\" directory with archived docs for download"
@@ -36,9 +37,9 @@
echo "Checking out Docutils..."; \
svn checkout $(SVNROOT)/external/docutils-0.5/docutils tools/docutils; \
fi
- @if [ ! -d tools/jinja ]; then \
+ @if [ ! -d tools/jinja2 ]; then \
echo "Checking out Jinja..."; \
- svn checkout $(SVNROOT)/external/Jinja-1.2/jinja tools/jinja; \
+ svn checkout $(SVNROOT)/external/Jinja-2.1.1/jinja2 tools/jinja2; \
fi
@if [ ! -d tools/pygments ]; then \
echo "Checking out Pygments..."; \
@@ -48,7 +49,7 @@
update: checkout
svn update tools/sphinx
svn update tools/docutils
- svn update tools/jinja
+ svn update tools/jinja2
svn update tools/pygments
build: checkout
@@ -84,6 +85,11 @@
@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"
+
coverage: BUILDER = coverage
coverage: build
@echo "Coverage finished; see c.txt and python.txt in build/coverage"
Modified: python/branches/py3k/Doc/library/ctypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/ctypes.rst (original)
+++ python/branches/py3k/Doc/library/ctypes.rst Fri Jan 9 04:03:23 2009
@@ -1853,7 +1853,7 @@
:module: ctypes.util
Try to find a library and return a pathname. *name* is the library name
- without any prefix like ``lib```, suffix like ``.so``, ``.dylib`` or version
+ without any prefix like ``lib``, suffix like ``.so``, ``.dylib`` or version
number (this is the form used for the posix linker option :option:`-l`). If
no library can be found, returns ``None``.
Modified: python/branches/py3k/Doc/library/ftplib.rst
==============================================================================
--- python/branches/py3k/Doc/library/ftplib.rst (original)
+++ python/branches/py3k/Doc/library/ftplib.rst Fri Jan 9 04:03:23 2009
@@ -1,4 +1,3 @@
-
:mod:`ftplib` --- FTP protocol client
=====================================
Modified: python/branches/py3k/Doc/library/multiprocessing.rst
==============================================================================
--- python/branches/py3k/Doc/library/multiprocessing.rst (original)
+++ python/branches/py3k/Doc/library/multiprocessing.rst Fri Jan 9 04:03:23 2009
@@ -1810,7 +1810,7 @@
* An ``'AF_PIPE'`` address is a string of the form
:samp:`r'\\\\.\\pipe\\{PipeName}'`. To use :func:`Client` to connect to a named
pipe on a remote computer called *ServerName* one should use an address of the
- form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'`` instead.
+ form :samp:`r'\\\\{ServerName}\\pipe\\{PipeName}'` instead.
Note that any string beginning with two backslashes is assumed by default to be
an ``'AF_PIPE'`` address rather than an ``'AF_UNIX'`` address.
Modified: python/branches/py3k/Doc/library/stdtypes.rst
==============================================================================
--- python/branches/py3k/Doc/library/stdtypes.rst (original)
+++ python/branches/py3k/Doc/library/stdtypes.rst Fri Jan 9 04:03:23 2009
@@ -322,6 +322,7 @@
module: math
single: floor() (in module math)
single: ceil() (in module math)
+ single: trunc() (in module math)
pair: numeric; conversions
pair: C; language
Modified: python/branches/py3k/Doc/make.bat
==============================================================================
--- python/branches/py3k/Doc/make.bat (original)
+++ python/branches/py3k/Doc/make.bat Fri Jan 9 04:03:23 2009
@@ -8,34 +8,41 @@
if "%1" EQU "" goto help
if "%1" EQU "html" goto build
if "%1" EQU "htmlhelp" goto build
-if "%1" EQU "web" goto build
-if "%1" EQU "webrun" goto webrun
+if "%1" EQU "latex" goto build
+if "%1" EQU "text" goto build
+if "%1" EQU "suspicious" goto build
+if "%1" EQU "linkcheck" goto build
+if "%1" EQU "changes" goto build
if "%1" EQU "checkout" goto checkout
if "%1" EQU "update" goto update
:help
+set this=%~n0
echo HELP
echo.
-echo builddoc checkout
-echo builddoc update
-echo builddoc html
-echo builddoc htmlhelp
-echo builddoc web
-echo builddoc webrun
+echo %this% checkout
+echo %this% update
+echo %this% html
+echo %this% htmlhelp
+echo %this% latex
+echo %this% text
+echo %this% suspicious
+echo %this% linkcheck
+echo %this% changes
echo.
goto end
:checkout
svn co %SVNROOT%/doctools/trunk/sphinx tools/sphinx
-svn co %SVNROOT%/external/docutils-0.4/docutils tools/docutils
-svn co %SVNROOT%/external/Jinja-1.1/jinja tools/jinja
-svn co %SVNROOT%/external/Pygments-0.9/pygments tools/pygments
+svn co %SVNROOT%/external/docutils-0.5/docutils tools/docutils
+svn co %SVNROOT%/external/Jinja-2.1.1/jinja2 tools/jinja2
+svn co %SVNROOT%/external/Pygments-0.11.1/pygments tools/pygments
goto end
:update
svn update tools/sphinx
svn update tools/docutils
-svn update tools/jinja
+svn update tools/jinja2
svn update tools/pygments
goto end
@@ -43,13 +50,8 @@
if not exist build mkdir build
if not exist build\%1 mkdir build\%1
if not exist build\doctrees mkdir build\doctrees
-cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%1
+cmd /C %PYTHON% tools\sphinx-build.py -b%1 -dbuild\doctrees . build\%*
if "%1" EQU "htmlhelp" "%HTMLHELP%" build\htmlhelp\pydoc.hhp
goto end
-:webrun
-set PYTHONPATH=tools
-%PYTHON% -m sphinx.web build\web
-goto end
-
:end
Modified: python/branches/py3k/Doc/tools/rstlint.py
==============================================================================
--- python/branches/py3k/Doc/tools/rstlint.py (original)
+++ python/branches/py3k/Doc/tools/rstlint.py Fri Jan 9 04:03:23 2009
@@ -62,12 +62,12 @@
@checker('.py', severity=4)
def check_syntax(fn, lines):
"""Check Python examples for valid syntax."""
+ code = ''.join(lines)
+ if '\r' in code:
+ if os.name != 'nt':
+ yield 0, '\\r in code file'
+ code = code.replace('\r', '')
try:
- code = ''.join(lines)
- if '\r' in code:
- if os.name != 'nt':
- yield 0, '\\r in code file'
- code = code.replace('\r', '')
compile(code, fn, 'exec')
except SyntaxError as err:
yield err.lineno, 'not compilable: %s' % err
Modified: python/branches/py3k/Doc/tools/sphinxext/pyspecific.py
==============================================================================
--- python/branches/py3k/Doc/tools/sphinxext/pyspecific.py (original)
+++ python/branches/py3k/Doc/tools/sphinxext/pyspecific.py Fri Jan 9 04:03:23 2009
@@ -46,15 +46,9 @@
from docutils.io import StringOutput
from docutils.utils import new_document
-try:
- from sphinx.builders import Builder
-except ImportError:
- from sphinx.builder import Builder
-
-try:
- from sphinx.writers.text import TextWriter
-except ImportError:
- from sphinx.textwriter import TextWriter
+from sphinx.builders import Builder
+from sphinx.writers.text import TextWriter
+
class PydocTopicsBuilder(Builder):
name = 'pydoc-topics'
@@ -90,6 +84,9 @@
finally:
f.close()
+# Support for checking for suspicious markup
+
+import suspicious
# Support for documenting Opcodes
@@ -114,5 +111,6 @@
def setup(app):
app.add_role('issue', issue_role)
app.add_builder(PydocTopicsBuilder)
+ app.add_builder(suspicious.CheckSuspiciousMarkupBuilder)
app.add_description_unit('opcode', 'opcode', '%s (opcode)',
parse_opcode_signature)
Copied: python/branches/py3k/Doc/tools/sphinxext/suspicious.py (from r68291, /python/trunk/Doc/tools/sphinxext/suspicious.py)
==============================================================================
--- /python/trunk/Doc/tools/sphinxext/suspicious.py (original)
+++ python/branches/py3k/Doc/tools/sphinxext/suspicious.py Fri Jan 9 04:03:23 2009
@@ -45,7 +45,7 @@
import csv
import re
from docutils import nodes
-from sphinx.builder import Builder
+from sphinx.builders import Builder
detect_all = re.compile(ur'''
::(?=[^=])| # two :: (but NOT ::=)
Modified: python/branches/py3k/Doc/whatsnew/2.6.rst
==============================================================================
--- python/branches/py3k/Doc/whatsnew/2.6.rst (original)
+++ python/branches/py3k/Doc/whatsnew/2.6.rst Fri Jan 9 04:03:23 2009
@@ -3217,6 +3217,9 @@
set ``__hash__ = None`` in their definitions to indicate
the fact.
+* String exceptions have been removed. Attempting to use them raises a
+ :exc:`TypeError`.
+
* The :meth:`__init__` method of :class:`collections.deque`
now clears any existing contents of the deque
before adding elements from the iterable. This change makes the
Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py
==============================================================================
--- python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py (original)
+++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports.py Fri Jan 9 04:03:23 2009
@@ -25,7 +25,6 @@
'tkFont': 'tkinter.font',
'tkMessageBox': 'tkinter.messagebox',
'ScrolledText': 'tkinter.scrolledtext',
- 'turtle': 'tkinter.turtle',
'Tkconstants': 'tkinter.constants',
'Tix': 'tkinter.tix',
'Tkinter': 'tkinter',
@@ -89,6 +88,10 @@
# This is overridden in fix_imports2.
mapping = MAPPING
+ # We want to run this fixer late, so fix_import doesn't try to make stdlib
+ # renames into relative imports.
+ run_order = 6
+
def build_pattern(self):
return "|".join(build_pattern(self.mapping))
Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py
==============================================================================
--- python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py (original)
+++ python/branches/py3k/Lib/lib2to3/fixes/fix_imports2.py Fri Jan 9 04:03:23 2009
@@ -11,6 +11,6 @@
class FixImports2(fix_imports.FixImports):
- run_order = 6
+ run_order = 7
mapping = MAPPING
Modified: python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py
==============================================================================
--- python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py (original)
+++ python/branches/py3k/Lib/lib2to3/fixes/fix_urllib.py Fri Jan 9 04:03:23 2009
@@ -15,7 +15,10 @@
'_urlopener', 'urlcleanup']),
('urllib.parse',
['quote', 'quote_plus', 'unquote', 'unquote_plus',
- 'urlencode', 'pahtname2url', 'url2pathname']),
+ 'urlencode', 'pathname2url', 'url2pathname', 'splitattr',
+ 'splithost', 'splitnport', 'splitpasswd', 'splitport',
+ 'splitquery', 'splittag', 'splittype', 'splituser',
+ 'splitvalue', ]),
('urllib.error',
['ContentTooShortError'])],
'urllib2' : [
@@ -34,12 +37,12 @@
'FTPHandler', 'CacheFTPHandler',
'UnknownHandler']),
('urllib.error',
- ['URLError', 'HTTPError'])],
+ ['URLError', 'HTTPError']),
+ ]
}
-
-# def alternates(members):
-# return "(" + "|".join(map(repr, members)) + ")"
+# Duplicate the url parsing functions for urllib2.
+MAPPING["urllib2"].append(MAPPING["urllib"][1])
def build_pattern():
Modified: python/branches/py3k/Lib/lib2to3/pgen2/driver.py
==============================================================================
--- python/branches/py3k/Lib/lib2to3/pgen2/driver.py (original)
+++ python/branches/py3k/Lib/lib2to3/pgen2/driver.py Fri Jan 9 04:03:23 2009
@@ -77,7 +77,8 @@
column = 0
else:
# We never broke out -- EOF is too soon (how can this happen???)
- raise parse.ParseError("incomplete input", t, v, x)
+ raise parse.ParseError("incomplete input",
+ type, value, (prefix, start))
return p.rootnode
def parse_stream_raw(self, stream, debug=False):
Modified: python/branches/py3k/Misc/build.sh
==============================================================================
--- python/branches/py3k/Misc/build.sh (original)
+++ python/branches/py3k/Misc/build.sh Fri Jan 9 04:03:23 2009
@@ -264,7 +264,7 @@
echo "Conflict detected in $CONFLICTED_FILE. Doc build skipped." > ../build/$F
err=1
else
- make update html >& ../build/$F
+ make checkout update html >& ../build/$F
err=$?
fi
update_status "Making doc" "$F" $start
More information about the Python-checkins
mailing list