]> granicus.if.org Git - python/commitdiff
Merged revisions 70578,70599,70641-70642,70650,70660-70661,70674,70691,70697-70698...
authorBenjamin Peterson <benjamin@python.org>
Mon, 30 Mar 2009 14:51:56 +0000 (14:51 +0000)
committerBenjamin Peterson <benjamin@python.org>
Mon, 30 Mar 2009 14:51:56 +0000 (14:51 +0000)
svn+ssh://pythondev@svn.python.org/python/trunk

........
  r70578 | benjamin.peterson | 2009-03-23 22:24:56 -0500 (Mon, 23 Mar 2009) | 1 line

  this is better written using assertRaises
........
  r70599 | benjamin.peterson | 2009-03-25 16:42:51 -0500 (Wed, 25 Mar 2009) | 1 line

  this can be slightly less ugly
........
  r70641 | guilherme.polo | 2009-03-27 16:43:08 -0500 (Fri, 27 Mar 2009) | 3 lines

  Adjusted _tkinter to compile without warnings when WITH_THREAD is not
  defined (part of issue #5035)
........
  r70642 | georg.brandl | 2009-03-27 19:48:48 -0500 (Fri, 27 Mar 2009) | 1 line

  Fix typo.
........
  r70650 | benjamin.peterson | 2009-03-28 14:16:10 -0500 (Sat, 28 Mar 2009) | 1 line

  give os.symlink and os.link() better parameter names #5564
........
  r70660 | georg.brandl | 2009-03-28 14:52:58 -0500 (Sat, 28 Mar 2009) | 1 line

  Switch to fixed Sphinx version.
........
  r70661 | georg.brandl | 2009-03-28 14:57:36 -0500 (Sat, 28 Mar 2009) | 2 lines

  Add section numbering to some of the larger subdocuments.
........
  r70674 | guilherme.polo | 2009-03-29 05:19:05 -0500 (Sun, 29 Mar 2009) | 1 line

  Typo fix.
........
  r70691 | raymond.hettinger | 2009-03-29 13:51:11 -0500 (Sun, 29 Mar 2009) | 1 line

  Make life easier for non-CPython implementations.
........
  r70697 | benjamin.peterson | 2009-03-29 16:22:35 -0500 (Sun, 29 Mar 2009) | 1 line

  this has been fixed since 2.6 (I love removing these)
........
  r70698 | benjamin.peterson | 2009-03-29 16:31:05 -0500 (Sun, 29 Mar 2009) | 1 line

  thanks to guido's bytecode verifier, this is fixed
........
  r70700 | benjamin.peterson | 2009-03-29 16:50:14 -0500 (Sun, 29 Mar 2009) | 1 line

  use the awesome new status iterator
........
  r70704 | benjamin.peterson | 2009-03-29 21:49:32 -0500 (Sun, 29 Mar 2009) | 1 line

  there's actually three methods here #5600
........

17 files changed:
Doc/Makefile
Doc/distutils/index.rst
Doc/documenting/index.rst
Doc/extending/index.rst
Doc/library/index.rst
Doc/library/os.rst
Doc/library/string.rst
Doc/library/webbrowser.rst
Doc/reference/index.rst
Doc/tools/sphinxext/pyspecific.py
Doc/tutorial/index.rst
Doc/using/index.rst
Lib/distutils/version.py
Lib/idlelib/configHandler.py
Lib/test/crashers/bogus_sre_bytecode.py [deleted file]
Lib/test/crashers/multithreaded_close.py [deleted file]
Modules/_tkinter.c

index 0fc112401e549ac0fbad1a1651a8351b5aea15fb..317fcb043866edaee925f0b2067c5ca412830569 100644 (file)
@@ -31,7 +31,7 @@ help:
 checkout:
        @if [ ! -d tools/sphinx ]; then \
          echo "Checking out Sphinx..."; \
-         svn checkout $(SVNROOT)/doctools/trunk/sphinx tools/sphinx; \
+         svn checkout $(SVNROOT)/external/Sphinx-0.6.1/sphinx tools/sphinx; \
        fi
        @if [ ! -d tools/docutils ]; then \
          echo "Checking out Docutils..."; \
index 6d82c847bb8233d1e217940a3f73c2e535cd5090..ace8280894edfb065ca3dcda85cc974491b54f16 100644 (file)
@@ -16,6 +16,7 @@ very little overhead for build/release/install mechanics.
 
 .. toctree::
    :maxdepth: 2
+   :numbered:
 
    introduction.rst
    setupscript.rst
index 5ec9fb64dbf2d336798f91d7a026b19c1d832d61..b64dc75ba56ef73a08e0e9fc3e4de9a37515af44 100644 (file)
@@ -23,6 +23,7 @@ to write reStructuredText if you're not so inclined; plain text contributions
 are more than welcome as well.
 
 .. toctree::
+   :numbered:
 
    intro.rst
    style.rst
index 6e8cf7906f6ee1ed9bb0e35d1a60e597e2d67b65..92e61327c19158630fc61ffcf12179744f890f25 100644 (file)
@@ -26,6 +26,7 @@ For a detailed description of the whole Python/C API, see the separate
 
 .. toctree::
    :maxdepth: 2
+   :numbered:
 
    extending.rst
    newtypes.rst
index 236b6e7ae00b66f04c070831c8254e1f384153ad..aa582dea1ab49e121549cd21cec48d46d8dab042 100644 (file)
@@ -38,6 +38,7 @@ the `Python Package Index <http://pypi.python.org/pypi>`_.
 
 .. toctree::
    :maxdepth: 2
+   :numbered:
 
    intro.rst
    functions.rst
index ef5beaa4d65f4ffa71d4d7649a202bd5715e5d1f..fc62b0b31d3380bc89727067fc20a5fcd840e973 100644 (file)
@@ -796,9 +796,10 @@ Files and Directories
    function will not follow symbolic links. Availability: Unix.
 
 
-.. function:: link(src, dst)
+.. function:: link(source, link_name)
 
-   Create a hard link pointing to *src* named *dst*. Availability: Unix.
+   Create a hard link pointing to *source* named *link_name*. Availability:
+   Unix.
 
 
 .. function:: listdir(path)
@@ -1078,9 +1079,10 @@ Files and Directories
    :attr:`f_flag`, :attr:`f_namemax`. Availability: Unix.
 
 
-.. function:: symlink(src, dst)
+.. function:: symlink(source, link_name)
 
-   Create a symbolic link pointing to *src* named *dst*. Availability: Unix.
+   Create a symbolic link pointing to *source* named *link_name*. Availability:
+   Unix.
 
 
 .. function:: unlink(path)
index 2e444adf3430a6253f02755fa39ad616227c8b8e..5867a5ae793a177fbc44897ee49928d055eccaa5 100644 (file)
@@ -218,6 +218,7 @@ does an index lookup using :func:`__getitem__`.
 Some simple format string examples::
 
    "First, thou shalt count to {0}" # References first positional argument
+   "Bring me a {}"                  # Implicitly references the first positional argument
    "My quest is {name}"             # References keyword argument 'name'
    "Weight in tons {0.weight}"      # 'weight' attribute of first positional arg
    "Units destroyed: {players[0]}"  # First element of keyword argument 'players'.
index ed56741a231cd342f600a08f2e082427a7400eff..c42283f0fc573723078ef5d3f829bddbe1733857 100644 (file)
@@ -167,8 +167,8 @@ Here are some simple examples::
 Browser Controller Objects
 --------------------------
 
-Browser controllers provide these methods which parallel two of the module-level
-convenience functions:
+Browser controllers provide these methods which parallel three of the
+module-level convenience functions:
 
 
 .. method:: controller.open(url[, new[, autoraise=1]])
index dff745c9d41c77537382f54a796dfd9ad434cd73..bd1a281efed65ab6cb806e559cbbd0f9d25bffcf 100644 (file)
@@ -18,6 +18,7 @@ interfaces available to C/C++ programmers in detail.
 
 .. toctree::
    :maxdepth: 2
+   :numbered:
 
    introduction.rst
    lexical_analysis.rst
index dc8a8349f944c1029295d92545f76437015a2619..024a5fa2d97f0e711b4de4ec818730862cfebfaf 100644 (file)
@@ -72,7 +72,9 @@ class PydocTopicsBuilder(Builder):
 
     def write(self, *ignored):
         writer = TextWriter(self)
-        for label in self.status_iterator(pydoc_topic_labels, 'building topics... '):
+        for label in self.status_iterator(pydoc_topic_labels,
+                                          'building topics... ',
+                                          length=len(pydoc_topic_labels)):
             if label not in self.env.labels:
                 self.warn('label %r not in documentation' % label)
                 continue
index dfc6ac0b0526580df774855c9c8ec109651f44d8..8a1a8fb6a758f8f6f571673be87c814c2e1cce76 100644 (file)
@@ -44,6 +44,7 @@ various Python library modules described in the Python Library Reference.
 The :ref:`glossary` is also worth going through.
 
 .. toctree::
+   :numbered:
 
    appetite.rst
    interpreter.rst
index ac5fd3cdc9704c2666d33bdcb68050c18c95edb2..6ce5a00de40999af8ff739de0b9d3b695dca405e 100644 (file)
@@ -11,6 +11,7 @@ interpreter and things that make working with Python easier.
 
 
 .. toctree::
+   :numbered:
 
    cmdline.rst
    unix.rst
index 79d458d8474c1306089aa583c5c508c1146a542e..ebcab84e4e23fd525f5017dc4969082fdf404fbc 100644 (file)
@@ -207,7 +207,7 @@ class StrictVersion (Version):
 
 
 # The rules according to Greg Stein:
-# 1) a version number has 1 or more numbers separate by a period or by
+# 1) a version number has 1 or more numbers separated by a period or by
 #    sequences of letters. If only periods, then these are compared
 #    left-to-right to determine an ordering.
 # 2) sequences of letters are part of the tuple for comparison and are
index 8b58bbed98da099eee38f4367f852cfc2236d764..73b8db5b23261bce4ab04724a27ed0eef41bcd14 100644 (file)
@@ -246,7 +246,7 @@ class IdleConf:
         else: #returning default, print warning
             if warn_on_default:
                 warning = ('\n Warning: configHandler.py - IdleConf.GetOption -\n'
-                           ' problem retrieving configration option %r\n'
+                           ' problem retrieving configuration option %r\n'
                            ' from section %r.\n'
                            ' returning default value: %r\n' %
                            (option, section, default))
diff --git a/Lib/test/crashers/bogus_sre_bytecode.py b/Lib/test/crashers/bogus_sre_bytecode.py
deleted file mode 100644 (file)
index 7f006d9..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-"""
-The regular expression engine in '_sre' can segfault when interpreting
-bogus bytecode.
-
-It is unclear whether this is a real bug or a "won't fix" case like
-bogus_code_obj.py, because it requires bytecode that is built by hand,
-as opposed to compiled by 're' from a string-source regexp.  The
-difference with bogus_code_obj, though, is that the only existing regexp
-compiler is written in Python, so that the C code has no choice but
-accept arbitrary bytecode from Python-level.
-
-The test below builds and runs random bytecodes until 'match' crashes
-Python.  I have not investigated why exactly segfaults occur nor how
-hard they would be to fix.  Here are a few examples of 'code' that
-segfault for me:
-
-    [21, 50814, 8, 29, 16]
-    [21, 3967, 26, 10, 23, 54113]
-    [29, 23, 0, 2, 5]
-    [31, 64351, 0, 28, 3, 22281, 20, 4463, 9, 25, 59154, 15245, 2,
-                  16343, 3, 11600, 24380, 10, 37556, 10, 31, 15, 31]
-
-Here is also a 'code' that triggers an infinite uninterruptible loop:
-
-    [29, 1, 8, 21, 1, 43083, 6]
-
-"""
-
-import _sre, random
-
-def pick():
-    n = random.randrange(-65536, 65536)
-    if n < 0:
-        n &= 31
-    return n
-
-ss = ["", "world", "x" * 500]
-
-while 1:
-    code = [pick() for i in range(random.randrange(5, 25))]
-    print(code)
-    pat = _sre.compile(None, 0, code)
-    for s in ss:
-        try:
-            pat.match(s)
-        except RuntimeError:
-            pass
diff --git a/Lib/test/crashers/multithreaded_close.py b/Lib/test/crashers/multithreaded_close.py
deleted file mode 100644 (file)
index f862d28..0000000
+++ /dev/null
@@ -1,14 +0,0 @@
-# f.close() is not thread-safe: calling it at the same time as another
-# operation (or another close) on the same file, but done from another
-# thread, causes crashes.  The issue is more complicated than it seems,
-# witness the discussions in:
-#
-# http://bugs.python.org/issue595601
-# http://bugs.python.org/issue815646
-
-import _thread
-
-while 1:
-    f = open("multithreaded_close.tmp", "w")
-    _thread.start_new_thread(f.close, ())
-    f.close()
index 9e7f374757c5def471540872af4f6f50ab4df0af..4d81058deb816c8a4338f6bf98951f4dcfbbbf48 100644 (file)
@@ -732,6 +732,7 @@ Tkapp_New(char *screenName, char *className,
 }
 
 
+#ifdef WITH_THREAD
 static void
 Tkapp_ThreadSend(TkappObject *self, Tcl_Event *ev,
                 Tcl_Condition *cond, Tcl_Mutex *mutex)
@@ -744,6 +745,7 @@ Tkapp_ThreadSend(TkappObject *self, Tcl_Event *ev,
        Tcl_MutexUnlock(mutex);
        Py_END_ALLOW_THREADS
 }
+#endif
 
 \f
 /** Tcl Eval **/
@@ -1110,8 +1112,8 @@ FromObj(PyObject* tkapp, Tcl_Obj *value)
        return newPyTclObject(value);
 }
 
+#ifdef WITH_THREAD
 /* This mutex synchronizes inter-thread command calls. */
-
 TCL_DECLARE_MUTEX(call_mutex)
 
 typedef struct Tkapp_CallEvent {
@@ -1123,6 +1125,7 @@ typedef struct Tkapp_CallEvent {
        PyObject **exc_type, **exc_value, **exc_tb;
        Tcl_Condition *done;
 } Tkapp_CallEvent;
+#endif
 
 void
 Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tcl_Obj** objStore, int objc)
@@ -1210,6 +1213,8 @@ Tkapp_CallResult(TkappObject *self)
        return res;
 }
 
+#ifdef WITH_THREAD
+
 /* Tkapp_CallProc is the event procedure that is executed in the context of
    the Tcl interpreter thread. Initially, it holds the Tcl lock, and doesn't
    hold the Python lock. */
@@ -1254,6 +1259,8 @@ done:
        return 1;
 }
 
+#endif
+
 /* This is the main entry point for calling a Tcl command.
    It supports three cases, with regard to threading:
    1. Tcl is not threaded: Must have the Tcl lock, then can invoke command in
@@ -1483,9 +1490,11 @@ Tkapp_AddErrorInfo(PyObject *self, PyObject *args)
 \f
 /** Tcl Variable **/
 
+typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags);
+
+#ifdef WITH_THREAD
 TCL_DECLARE_MUTEX(var_mutex)
 
-typedef PyObject* (*EventFunc)(PyObject*, PyObject *args, int flags);
 typedef struct VarEvent {
        Tcl_Event ev; /* must be first */
        PyObject *self;
@@ -1497,6 +1506,7 @@ typedef struct VarEvent {
        PyObject **exc_val;
        Tcl_Condition *cond;
 } VarEvent;
+#endif
 
 static int
 varname_converter(PyObject *in, void *_out)
@@ -1518,6 +1528,8 @@ varname_converter(PyObject *in, void *_out)
        return 0;
 }
 
+#ifdef WITH_THREAD
+
 static void
 var_perform(VarEvent *ev)
 {
@@ -1545,11 +1557,13 @@ var_proc(VarEvent* ev, int flags)
        return 1;
 }
 
+#endif
+
 static PyObject*
 var_invoke(EventFunc func, PyObject *selfptr, PyObject *args, int flags)
 {
-       TkappObject *self = (TkappObject*)selfptr;
 #ifdef WITH_THREAD
+       TkappObject *self = (TkappObject*)selfptr;
        if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
                TkappObject *self = (TkappObject*)selfptr;
                VarEvent *ev;
@@ -2052,6 +2066,7 @@ PythonCmdDelete(ClientData clientData)
 
 \f
 
+#ifdef WITH_THREAD
 TCL_DECLARE_MUTEX(command_mutex)
 
 typedef struct CommandEvent{
@@ -2078,6 +2093,7 @@ Tkapp_CommandProc(CommandEvent *ev, int flags)
        Tcl_MutexUnlock(&command_mutex);
        return 1;
 }
+#endif
 
 static PyObject *
 Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
@@ -2108,7 +2124,7 @@ Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
        Py_INCREF(func);
        data->self = selfptr;
        data->func = func;
-
+#ifdef WITH_THREAD
        if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
                Tcl_Condition cond = NULL;
                CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
@@ -2122,7 +2138,9 @@ Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
                Tkapp_ThreadSend(self, (Tcl_Event*)ev, &cond, &command_mutex);
                Tcl_ConditionFinalize(&cond);
        }
-       else {
+       else
+#endif
+       {
                ENTER_TCL
                err = Tcl_CreateCommand(
                        Tkapp_Interp(self), cmdName, PythonCmd,
@@ -2150,6 +2168,8 @@ Tkapp_DeleteCommand(PyObject *selfptr, PyObject *args)
 
        if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName))
                return NULL;
+
+#ifdef WITH_THREAD
        if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
                Tcl_Condition cond = NULL;
                CommandEvent *ev;
@@ -2164,7 +2184,9 @@ Tkapp_DeleteCommand(PyObject *selfptr, PyObject *args)
                                 &command_mutex);
                Tcl_ConditionFinalize(&cond);
        }
-       else {
+       else
+#endif
+       {
                ENTER_TCL
                err = Tcl_DeleteCommand(self->interp, cmdName);
                LEAVE_TCL