[Python-checkins] r70708 - in python/branches/release30-maint: 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 Lib/test/crashers/multithreaded_close.py Modules/_tkinter.c
benjamin.peterson
python-checkins at python.org
Mon Mar 30 16:55:03 CEST 2009
Author: benjamin.peterson
Date: Mon Mar 30 16:55:02 2009
New Revision: 70708
Log:
Merged revisions 70707 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/branches/py3k
................
r70707 | benjamin.peterson | 2009年03月30日 09:51:56 -0500 (2009年3月30日) | 58 lines
Merged revisions 70578,70599,70641-70642,70650,70660-70661,70674,70691,70697-70698,70700,70704 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk
........
r70578 | benjamin.peterson | 2009年03月23日 22:24:56 -0500 (2009年3月23日) | 1 line
this is better written using assertRaises
........
r70599 | benjamin.peterson | 2009年03月25日 16:42:51 -0500 (2009年3月25日) | 1 line
this can be slightly less ugly
........
r70641 | guilherme.polo | 2009年03月27日 16:43:08 -0500 (2009年3月27日) | 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 (2009年3月27日) | 1 line
Fix typo.
........
r70650 | benjamin.peterson | 2009年03月28日 14:16:10 -0500 (2009年3月28日) | 1 line
give os.symlink and os.link() better parameter names #5564
........
r70660 | georg.brandl | 2009年03月28日 14:52:58 -0500 (2009年3月28日) | 1 line
Switch to fixed Sphinx version.
........
r70661 | georg.brandl | 2009年03月28日 14:57:36 -0500 (2009年3月28日) | 2 lines
Add section numbering to some of the larger subdocuments.
........
r70674 | guilherme.polo | 2009年03月29日 05:19:05 -0500 (2009年3月29日) | 1 line
Typo fix.
........
r70691 | raymond.hettinger | 2009年03月29日 13:51:11 -0500 (2009年3月29日) | 1 line
Make life easier for non-CPython implementations.
........
r70697 | benjamin.peterson | 2009年03月29日 16:22:35 -0500 (2009年3月29日) | 1 line
this has been fixed since 2.6 (I love removing these)
........
r70698 | benjamin.peterson | 2009年03月29日 16:31:05 -0500 (2009年3月29日) | 1 line
thanks to guido's bytecode verifier, this is fixed
........
r70700 | benjamin.peterson | 2009年03月29日 16:50:14 -0500 (2009年3月29日) | 1 line
use the awesome new status iterator
........
r70704 | benjamin.peterson | 2009年03月29日 21:49:32 -0500 (2009年3月29日) | 1 line
there's actually three methods here #5600
........
................
Removed:
python/branches/release30-maint/Lib/test/crashers/bogus_sre_bytecode.py
python/branches/release30-maint/Lib/test/crashers/multithreaded_close.py
Modified:
python/branches/release30-maint/ (props changed)
python/branches/release30-maint/Doc/Makefile
python/branches/release30-maint/Doc/distutils/index.rst
python/branches/release30-maint/Doc/documenting/index.rst
python/branches/release30-maint/Doc/extending/index.rst
python/branches/release30-maint/Doc/library/index.rst
python/branches/release30-maint/Doc/library/os.rst
python/branches/release30-maint/Doc/library/string.rst
python/branches/release30-maint/Doc/library/webbrowser.rst
python/branches/release30-maint/Doc/reference/index.rst
python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py
python/branches/release30-maint/Doc/tutorial/index.rst
python/branches/release30-maint/Doc/using/index.rst
python/branches/release30-maint/Lib/distutils/version.py
python/branches/release30-maint/Lib/idlelib/configHandler.py
python/branches/release30-maint/Modules/_tkinter.c
Modified: python/branches/release30-maint/Doc/Makefile
==============================================================================
--- python/branches/release30-maint/Doc/Makefile (original)
+++ python/branches/release30-maint/Doc/Makefile Mon Mar 30 16:55:02 2009
@@ -31,7 +31,7 @@
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..."; \
Modified: python/branches/release30-maint/Doc/distutils/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/distutils/index.rst (original)
+++ python/branches/release30-maint/Doc/distutils/index.rst Mon Mar 30 16:55:02 2009
@@ -16,6 +16,7 @@
.. toctree::
:maxdepth: 2
+ :numbered:
introduction.rst
setupscript.rst
Modified: python/branches/release30-maint/Doc/documenting/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/documenting/index.rst (original)
+++ python/branches/release30-maint/Doc/documenting/index.rst Mon Mar 30 16:55:02 2009
@@ -23,6 +23,7 @@
are more than welcome as well.
.. toctree::
+ :numbered:
intro.rst
style.rst
Modified: python/branches/release30-maint/Doc/extending/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/extending/index.rst (original)
+++ python/branches/release30-maint/Doc/extending/index.rst Mon Mar 30 16:55:02 2009
@@ -26,6 +26,7 @@
.. toctree::
:maxdepth: 2
+ :numbered:
extending.rst
newtypes.rst
Modified: python/branches/release30-maint/Doc/library/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/library/index.rst (original)
+++ python/branches/release30-maint/Doc/library/index.rst Mon Mar 30 16:55:02 2009
@@ -38,6 +38,7 @@
.. toctree::
:maxdepth: 2
+ :numbered:
intro.rst
functions.rst
Modified: python/branches/release30-maint/Doc/library/os.rst
==============================================================================
--- python/branches/release30-maint/Doc/library/os.rst (original)
+++ python/branches/release30-maint/Doc/library/os.rst Mon Mar 30 16:55:02 2009
@@ -796,9 +796,10 @@
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 @@
: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)
Modified: python/branches/release30-maint/Doc/library/string.rst
==============================================================================
--- python/branches/release30-maint/Doc/library/string.rst (original)
+++ python/branches/release30-maint/Doc/library/string.rst Mon Mar 30 16:55:02 2009
@@ -218,6 +218,7 @@
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'.
Modified: python/branches/release30-maint/Doc/library/webbrowser.rst
==============================================================================
--- python/branches/release30-maint/Doc/library/webbrowser.rst (original)
+++ python/branches/release30-maint/Doc/library/webbrowser.rst Mon Mar 30 16:55:02 2009
@@ -167,8 +167,8 @@
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]])
Modified: python/branches/release30-maint/Doc/reference/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/reference/index.rst (original)
+++ python/branches/release30-maint/Doc/reference/index.rst Mon Mar 30 16:55:02 2009
@@ -18,6 +18,7 @@
.. toctree::
:maxdepth: 2
+ :numbered:
introduction.rst
lexical_analysis.rst
Modified: python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py
==============================================================================
--- python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py (original)
+++ python/branches/release30-maint/Doc/tools/sphinxext/pyspecific.py Mon Mar 30 16:55:02 2009
@@ -79,7 +79,9 @@
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
Modified: python/branches/release30-maint/Doc/tutorial/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/tutorial/index.rst (original)
+++ python/branches/release30-maint/Doc/tutorial/index.rst Mon Mar 30 16:55:02 2009
@@ -44,6 +44,7 @@
The :ref:`glossary` is also worth going through.
.. toctree::
+ :numbered:
appetite.rst
interpreter.rst
Modified: python/branches/release30-maint/Doc/using/index.rst
==============================================================================
--- python/branches/release30-maint/Doc/using/index.rst (original)
+++ python/branches/release30-maint/Doc/using/index.rst Mon Mar 30 16:55:02 2009
@@ -11,6 +11,7 @@
.. toctree::
+ :numbered:
cmdline.rst
unix.rst
Modified: python/branches/release30-maint/Lib/distutils/version.py
==============================================================================
--- python/branches/release30-maint/Lib/distutils/version.py (original)
+++ python/branches/release30-maint/Lib/distutils/version.py Mon Mar 30 16:55:02 2009
@@ -207,7 +207,7 @@
# 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
Modified: python/branches/release30-maint/Lib/idlelib/configHandler.py
==============================================================================
--- python/branches/release30-maint/Lib/idlelib/configHandler.py (original)
+++ python/branches/release30-maint/Lib/idlelib/configHandler.py Mon Mar 30 16:55:02 2009
@@ -246,7 +246,7 @@
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))
Deleted: python/branches/release30-maint/Lib/test/crashers/bogus_sre_bytecode.py
==============================================================================
--- python/branches/release30-maint/Lib/test/crashers/bogus_sre_bytecode.py Mon Mar 30 16:55:02 2009
+++ (empty file)
@@ -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
Deleted: python/branches/release30-maint/Lib/test/crashers/multithreaded_close.py
==============================================================================
--- python/branches/release30-maint/Lib/test/crashers/multithreaded_close.py Mon Mar 30 16:55:02 2009
+++ (empty file)
@@ -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()
Modified: python/branches/release30-maint/Modules/_tkinter.c
==============================================================================
--- python/branches/release30-maint/Modules/_tkinter.c (original)
+++ python/branches/release30-maint/Modules/_tkinter.c Mon Mar 30 16:55:02 2009
@@ -696,6 +696,7 @@
}
+#ifdef WITH_THREAD
static void
Tkapp_ThreadSend(TkappObject *self, Tcl_Event *ev,
Tcl_Condition *cond, Tcl_Mutex *mutex)
@@ -708,6 +709,7 @@
Tcl_MutexUnlock(mutex);
Py_END_ALLOW_THREADS
}
+#endif
/** Tcl Eval **/
@@ -1074,8 +1076,8 @@
return newPyTclObject(value);
}
+#ifdef WITH_THREAD
/* This mutex synchronizes inter-thread command calls. */
-
TCL_DECLARE_MUTEX(call_mutex)
typedef struct Tkapp_CallEvent {
@@ -1087,6 +1089,7 @@
PyObject **exc_type, **exc_value, **exc_tb;
Tcl_Condition done;
} Tkapp_CallEvent;
+#endif
void
Tkapp_CallDeallocArgs(Tcl_Obj** objv, Tcl_Obj** objStore, int objc)
@@ -1174,6 +1177,8 @@
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. */
@@ -1218,6 +1223,8 @@
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
@@ -1445,9 +1452,11 @@
/** 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;
@@ -1459,6 +1468,7 @@
PyObject **exc_val;
Tcl_Condition cond;
} VarEvent;
+#endif
static int
varname_converter(PyObject *in, void *_out)
@@ -1480,6 +1490,8 @@
return 0;
}
+#ifdef WITH_THREAD
+
static void
var_perform(VarEvent *ev)
{
@@ -1507,11 +1519,13 @@
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;
@@ -2012,6 +2026,7 @@
+#ifdef WITH_THREAD
TCL_DECLARE_MUTEX(command_mutex)
typedef struct CommandEvent{
@@ -2038,6 +2053,7 @@
Tcl_MutexUnlock(&command_mutex);
return 1;
}
+#endif
static PyObject *
Tkapp_CreateCommand(PyObject *selfptr, PyObject *args)
@@ -2068,7 +2084,7 @@
Py_INCREF(func);
data->self = selfptr;
data->func = func;
-
+#ifdef WITH_THREAD
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
CommandEvent *ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
ev->ev.proc = (Tcl_EventProc*)Tkapp_CommandProc;
@@ -2080,7 +2096,9 @@
ev->done = NULL;
Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done, &command_mutex);
}
- else {
+ else
+#endif
+ {
ENTER_TCL
err = Tcl_CreateCommand(
Tkapp_Interp(self), cmdName, PythonCmd,
@@ -2108,6 +2126,8 @@
if (!PyArg_ParseTuple(args, "s:deletecommand", &cmdName))
return NULL;
+
+#ifdef WITH_THREAD
if (self->threaded && self->thread_id != Tcl_GetCurrentThread()) {
CommandEvent *ev;
ev = (CommandEvent*)ckalloc(sizeof(CommandEvent));
@@ -2120,7 +2140,9 @@
Tkapp_ThreadSend(self, (Tcl_Event*)ev, &ev->done,
&command_mutex);
}
- else {
+ else
+#endif
+ {
ENTER_TCL
err = Tcl_DeleteCommand(self->interp, cmdName);
LEAVE_TCL
More information about the Python-checkins
mailing list