Skip to content

Commit c935500

Browse files
author
amaury.forgeotdarc
committed
Merged revisions 67295,67301-67302,67318,67330,67342-67343 via svnmerge from
svn+ssh://pythondev@svn.python.org/python/trunk ........ r67295 | benjamin.peterson | 2008-11-20 05:05:12 +0100 (jeu., 20 nov. 2008) | 1 line move useful sys.settrace information to the function's documentation from the debugger ........ r67301 | benjamin.peterson | 2008-11-20 22:25:31 +0100 (jeu., 20 nov. 2008) | 1 line fix indentation and a sphinx warning ........ r67302 | benjamin.peterson | 2008-11-20 22:44:23 +0100 (jeu., 20 nov. 2008) | 1 line oops! didn't mean to disable that test ........ r67318 | amaury.forgeotdarc | 2008-11-21 23:05:48 +0100 (ven., 21 nov. 2008) | 4 lines #4363: Let uuid.uuid1() and uuid.uuid4() run even if the ctypes module is not present. Will backport to 2.6 ........ r67330 | georg.brandl | 2008-11-22 09:34:14 +0100 (sam., 22 nov. 2008) | 2 lines #4364: fix attribute name on ctypes object. ........ r67342 | amaury.forgeotdarc | 2008-11-22 20:39:38 +0100 (sam., 22 nov. 2008) | 3 lines yuvconvert.c is a part of the "sv" module, an old IRIX thing and certainly not useful for any Windows build. ........ r67343 | amaury.forgeotdarc | 2008-11-22 21:01:18 +0100 (sam., 22 nov. 2008) | 5 lines #3996: On Windows, PyOS_CheckStack is supposed to protect the interpreter from stack overflow. But doing this, it always crashes when the stack is nearly full. Reviewed by Martin von Loewis. Will backport to 2.6. ........ git-svn-id: http://svn.python.org/projects/python/branches/py3k@67345 6015fed2-1504-0410-9fe1-9d1591cc4771
1 parent bdd59c1 commit c935500

13 files changed

Lines changed: 69 additions & 104 deletions

File tree

Doc/library/multiprocessing.rst

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -872,7 +872,7 @@ inherited by child processes.
872872

873873
Note that *lock* is a keyword only argument.
874874

875-
Note that an array of :data:`ctypes.c_char` has *value* and *rawvalue*
875+
Note that an array of :data:`ctypes.c_char` has *value* and *raw*
876876
attributes which allow one to use it to store and retrieve strings.
877877

878878

@@ -921,7 +921,7 @@ processes.
921921
:func:`Value` instead to make sure that access is automatically synchronized
922922
using a lock.
923923

924-
Note that an array of :data:`ctypes.c_char` has ``value`` and ``rawvalue``
924+
Note that an array of :data:`ctypes.c_char` has ``value`` and ``raw``
925925
attributes which allow one to use it to store and retrieve strings -- see
926926
documentation for :mod:`ctypes`.
927927

Doc/library/pdb.rst

Lines changed: 0 additions & 65 deletions
Original file line numberDiff line numberDiff line change
@@ -336,68 +336,3 @@ run [*args* ...]
336336

337337
q(uit)
338338
Quit from the debugger. The program being executed is aborted.
339-
340-
341-
.. _debugger-hooks:
342-
343-
How It Works
344-
============
345-
346-
Some changes were made to the interpreter:
347-
348-
* ``sys.settrace(func)`` sets the global trace function
349-
350-
* there can also a local trace function (see later)
351-
352-
Trace functions have three arguments: *frame*, *event*, and *arg*. *frame* is
353-
the current stack frame. *event* is a string: ``'call'``, ``'line'``,
354-
``'return'``, ``'exception'``, ``'c_call'``, ``'c_return'``, or
355-
``'c_exception'``. *arg* depends on the event type.
356-
357-
The global trace function is invoked (with *event* set to ``'call'``) whenever a
358-
new local scope is entered; it should return a reference to the local trace
359-
function to be used that scope, or ``None`` if the scope shouldn't be traced.
360-
361-
The local trace function should return a reference to itself (or to another
362-
function for further tracing in that scope), or ``None`` to turn off tracing in
363-
that scope.
364-
365-
Instance methods are accepted (and very useful!) as trace functions.
366-
367-
The events have the following meaning:
368-
369-
``'call'``
370-
A function is called (or some other code block entered). The global trace
371-
function is called; *arg* is ``None``; the return value specifies the local
372-
trace function.
373-
374-
``'line'``
375-
The interpreter is about to execute a new line of code (sometimes multiple line
376-
events on one line exist). The local trace function is called; *arg* is
377-
``None``; the return value specifies the new local trace function.
378-
379-
``'return'``
380-
A function (or other code block) is about to return. The local trace function
381-
is called; *arg* is the value that will be returned. The trace function's
382-
return value is ignored.
383-
384-
``'exception'``
385-
An exception has occurred. The local trace function is called; *arg* is a
386-
triple ``(exception, value, traceback)``; the return value specifies the new
387-
local trace function.
388-
389-
``'c_call'``
390-
A C function is about to be called. This may be an extension function or a
391-
builtin. *arg* is the C function object.
392-
393-
``'c_return'``
394-
A C function has returned. *arg* is ``None``.
395-
396-
``'c_exception'``
397-
A C function has thrown an exception. *arg* is ``None``.
398-
399-
Note that as an exception is propagated down the chain of callers, an
400-
``'exception'`` event is generated at each level.
401-
402-
For more information on code and frame objects, refer to :ref:`types`.
403-

Doc/library/sys.rst

Lines changed: 51 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -623,11 +623,60 @@ always available.
623623
single: debugger
624624

625625
Set the system's trace function, which allows you to implement a Python
626-
source code debugger in Python. See section :ref:`debugger-hooks` in the
627-
chapter on the Python debugger. The function is thread-specific; for a
626+
source code debugger in Python. The function is thread-specific; for a
628627
debugger to support multiple threads, it must be registered using
629628
:func:`settrace` for each thread being debugged.
630629

630+
Trace functions should have three arguments: *frame*, *event*, and
631+
*arg*. *frame* is the current stack frame. *event* is a string: ``'call'``,
632+
``'line'``, ``'return'``, ``'exception'``, ``'c_call'``, ``'c_return'``, or
633+
``'c_exception'``. *arg* depends on the event type.
634+
635+
The trace function is invoked (with *event* set to ``'call'``) whenever a new
636+
local scope is entered; it should return a reference to a local trace
637+
function to be used that scope, or ``None`` if the scope shouldn't be traced.
638+
639+
The local trace function should return a reference to itself (or to another
640+
function for further tracing in that scope), or ``None`` to turn off tracing
641+
in that scope.
642+
643+
The events have the following meaning:
644+
645+
``'call'``
646+
A function is called (or some other code block entered). The
647+
global trace function is called; *arg* is ``None``; the return value
648+
specifies the local trace function.
649+
650+
``'line'``
651+
The interpreter is about to execute a new line of code (sometimes multiple
652+
line events on one line exist). The local trace function is called; *arg*
653+
is ``None``; the return value specifies the new local trace function.
654+
655+
``'return'``
656+
A function (or other code block) is about to return. The local trace
657+
function is called; *arg* is the value that will be returned. The trace
658+
function's return value is ignored.
659+
660+
``'exception'``
661+
An exception has occurred. The local trace function is called; *arg* is a
662+
tuple ``(exception, value, traceback)``; the return value specifies the
663+
new local trace function.
664+
665+
``'c_call'``
666+
A C function is about to be called. This may be an extension function or
667+
a builtin. *arg* is the C function object.
668+
669+
``'c_return'``
670+
A C function has returned. *arg* is ``None``.
671+
672+
``'c_exception'``
673+
A C function has thrown an exception. *arg* is ``None``.
674+
675+
Note that as an exception is propagated down the chain of callers, an
676+
``'exception'`` event is generated at each level.
677+
678+
For more information on code and frame objects, refer to :ref:`types`.
679+
631680
.. note::
632681

633682
The :func:`settrace` function is intended only for implementing debuggers,

Lib/test/test_bytes.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -742,7 +742,7 @@ def test_copied(self):
742742
# Issue 4348. Make sure that operations that don't mutate the array
743743
# copy the bytes.
744744
b = bytearray(b'abc')
745-
#self.assertFalse(b is b.replace(b'abc', b'cde', 0))
745+
self.assertFalse(b is b.replace(b'abc', b'cde', 0))
746746

747747
t = bytearray([i for i in range(256)])
748748
x = bytearray(b'')

Lib/uuid.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -500,8 +500,8 @@ def uuid1(node=None, clock_seq=None):
500500

501501
# When the system provides a version-1 UUID generator, use it (but don't
502502
# use UuidCreate here because its UUIDs don't conform to RFC 4122).
503-
_buffer = ctypes.create_string_buffer(16)
504503
if _uuid_generate_time and node is clock_seq is None:
504+
_buffer = ctypes.create_string_buffer(16)
505505
_uuid_generate_time(_buffer)
506506
return UUID(bytes=bytes_(_buffer.raw))
507507

@@ -537,8 +537,8 @@ def uuid4():
537537
"""Generate a random UUID."""
538538

539539
# When the system provides a version-4 UUID generator, use it.
540-
_buffer = ctypes.create_string_buffer(16)
541540
if _uuid_generate_random:
541+
_buffer = ctypes.create_string_buffer(16)
542542
_uuid_generate_random(_buffer)
543543
return UUID(bytes=bytes_(_buffer.raw))
544544

Misc/NEWS

Lines changed: 10 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -12,6 +12,13 @@ What's New in Python 3.0 final
1212
Core and Builtins
1313
-----------------
1414

15+
- Issue #3996: On Windows, the PyOS_CheckStack function would cause the
16+
interpreter to abort ("Fatal Python error: Could not reset the stack!")
17+
instead of throwing a MemoryError.
18+
19+
- Issue #4367: Python would segfault during compiling when the unicodedata
20+
module couldn't be imported and \N escapes were present.
21+
1522
Library
1623
-------
1724

@@ -48,6 +55,9 @@ Core and Builtins
4855
Library
4956
-------
5057

58+
- Issue #4363: The uuid.uuid1() and uuid.uuid4() functions now work even if
59+
the ctypes module is not present.
60+
5161
- FileIO's mode attribute now always includes ``"b"``.
5262

5363
- Issue #3799: Fix dbm.dumb to accept strings as well as bytes for keys. String

PC/VC6/pythoncore.dsp

Lines changed: 0 additions & 4 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

PC/VS7.1/pythoncore.vcproj

Lines changed: 0 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -803,9 +803,6 @@
803803
<File
804804
RelativePath="..\..\Modules\xxsubtype.c">
805805
</File>
806-
<File
807-
RelativePath="..\..\Modules\yuvconvert.c">
808-
</File>
809806
<File
810807
RelativePath="..\..\Modules\zipimport.c">
811808
</File>

PC/VS8.0/pythoncore.vcproj

Lines changed: 0 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -1142,14 +1142,6 @@
11421142
RelativePath="..\..\Modules\xxsubtype.c"
11431143
>
11441144
</File>
1145-
<File
1146-
RelativePath="..\..\Modules\yuv.h"
1147-
>
1148-
</File>
1149-
<File
1150-
RelativePath="..\..\Modules\yuvconvert.c"
1151-
>
1152-
</File>
11531145
<File
11541146
RelativePath="..\..\Modules\zipimport.c"
11551147
>

PC/os2vacpp/makefile

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -200,8 +200,7 @@ MODULES = \
200200
$(PATHOBJ)\StropModule.obj \
201201
$(PATHOBJ)\StructModule.obj \
202202
$(PATHOBJ)\TimeModule.obj \
203-
$(PATHOBJ)\ThreadModule.obj \
204-
$(PATHOBJ)\YUVConvert.obj
203+
$(PATHOBJ)\ThreadModule.obj
205204

206205
# Standalone Parser Generator Program (Shares Some of Python's Modules)
207206
PGEN = \
@@ -894,8 +893,6 @@ xxmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\class
894893
$(PY_INCLUDE)\sliceobject.h $(PY_INCLUDE)\stringobject.h \
895894
$(PY_INCLUDE)\sysmodule.h $(PY_INCLUDE)\traceback.h $(PY_INCLUDE)\tupleobject.h
896895

897-
yuvconvert.obj: $(PY_MODULES)\yuv.h
898-
899896
zlibmodule.obj: $(PY_INCLUDE)\abstract.h $(PY_INCLUDE)\ceval.h $(PY_INCLUDE)\classobject.h \
900897
$(PY_INCLUDE)\cobject.h $(PY_INCLUDE)\complexobject.h pyconfig.h \
901898
$(PY_INCLUDE)\dictobject.h $(PY_INCLUDE)\fileobject.h $(PY_INCLUDE)\floatobject.h \

0 commit comments

Comments
 (0)