[Python-Dev] [Python-checkins] cpython: edit and rewrite
Victor Stinner
victor.stinner at haypocalc.com
Sun Jun 19 16:17:04 CEST 2011
Le samedi 18 juin 2011 à 02:51 +0200, benjamin.peterson a écrit :
> .. function:: dump_traceback(file=sys.stderr, all_threads=True)
>
> - Dump the traceback of all threads, or of the current thread if *all_threads*
> - is ``False``, into *file*.
> + Dump the traceback of all threads into *file*. If *all_threads* is ``True``,
> + produce tracebacks for every running thread. Otherwise, dump only the current
> + thread.
The first sentence is confusing. I suggest:
Dump the traceback of all threads into *file*. If *all_threads* is
``False``, dump the traceback of only the current thread.
or
Dump the traceback into *file*. If *all_threads* is ``True``, produce
tracebacks for every running thread. Otherwise, dump only the current
thread.
> @@ -69,15 +75,14 @@
> .. function:: dump_tracebacks_later(timeout, repeat=False, file=sys.stderr, exit=False)
>
> Dump the tracebacks of all threads, after a timeout of *timeout* seconds, or
> - each *timeout* seconds if *repeat* is ``True``. If *exit* is True, call
> - :c:func:`_exit` with status=1 after dumping the tracebacks to terminate
> - immediatly the process, which is not safe. For example, :c:func:`_exit`
> - doesn't flush file buffers. If the function is called twice, the new call
> - replaces previous parameters (resets the timeout). The timer has a
> - sub-second resolution.
> + every *timeout* seconds if *repeat* is ``True``. If *exit* is ``True``, call
> + :c:func:`_exit` with status=1 after dumping the tracebacks. (Note
> + :c:func:`_exit` doesn't flush file buffers.) If the function is called twice,
> + the new call replaces previous parameters and resets the timeout. The timer
> + has a sub-second resolution.
You removed "to terminate immediatly the process, which is not safe"
sentence which is very important. It doesn't exit like sys.exit(): it
exits immediatly. Not flushing file buffers is just an example.
Anyway, thank you for rephrasing the doc.
Victor
More information about the Python-Dev
mailing list