| Commit message (Collapse) | Author | Age | Files | Lines |
... | |
| |
|
| |
|
| |
|
|
|
|
| |
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Pablo Galindo <pablogsal@gmail.com>
|
|
|
|
|
|
| |
As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead
of -1 if there is no line number.
Signed-off-by: Filipe Laíns <lains@riseup.net>
|
|
|
|
|
|
|
|
| |
The traceback.c and traceback.py mechanisms now utilize the newly added code.co_positions and PyCode_Addr2Location
to print carets on the specific expressions involved in a traceback.
Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
Co-authored-by: Ammar Askar <ammar@ammaraskar.com>
Co-authored-by: Batuhan Taskaya <batuhanosmantaskaya@gmail.com>
|
|
|
|
|
| |
(GH-24331)
…inel defaults
|
| |
|
|
|
|
|
| |
(GH-24629)
(The previous commit fixed print_exception(None, None, None).)
|
| |
|
|
|
| |
Use it to reduce the time and memory taken up by several of traceback's module-level functions.
|
| |
|
|
|
|
| |
without a lineno (GH-23427)
|
| |
|
|
|
|
|
|
| |
The format_exception(), format_exception_only(), and
print_exception() functions can now take an exception object as a positional-only argument.
Co-Authored-By: Matthias Bussonnier <bussonniermatthias@gmail.com>
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
This fixes both the traceback.py module and the C code for formatting syntax errors (in Python/pythonrun.c). They now both consistently do the following:
- Suppress caret if it points left of text
- Allow caret pointing just past end of line
- If caret points past end of line, clip to *just* past end of line
The syntax error formatting code in traceback.py was mostly rewritten; small, subtle changes were applied to the C code in pythonrun.c.
There's still a difference when the text contains embedded newlines. Neither handles these very well, and I don't think the case occurs in practice.
Automerge-Triggered-By: @gvanrossum
|
|
|
| |
Typo fix: "emites" -> "emit".
|
|
|
|
| |
They now return NotImplemented for unsupported type of the other operand.
|
| |
|
|
|
|
|
|
|
|
| |
The recursive frame pruning code always undercounted the number of elided frames
by one. That is, in the "[Previous line repeated N more times]" message, N would
always be one too few. Near the recursive pruning cutoff, one frame could be
silently dropped. That situation is demonstrated in the OP of the bug report.
The fix is to start the identical frame counter at 1.
|
|
|
|
|
|
|
|
|
|
| |
In the documentation for the traceback module, the definitions of functions
extract_tb(), format_list() and classmethod StackSummary.from_list()
mention the old style 4-tuples that these functions used to return or accept.
Since Python 3.5, however, they return or accept a FrameSummary object
instead of a 4-tuple, or a StackSummary object instead of a list of 4-tuples.
Co-Authored-By: Berker Peksag <berker.peksag@gmail.com>
|
| |
|
|
|
|
|
|
|
|
| |
* Replaced list(<generator expression>) with list comprehension
* Replaced dict(<generator expression>) with dict comprehension
* Replaced set(<list literal>) with set literal
* Replaced builtin func(<list comprehension>) with func(<generator
expression>) when supported (e.g. any(), all(), tuple(), min(), &
max())
|
|\ |
|
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| |
| | |
This fixes a regression caused by revision 73afda5a4e4c. Also reverts the
decimal test workaround added in revision 5f3dd0a2b1ab.
Remove test_without_exception(). According to revision ecaafc32c500, this was
added in Python 2 so that print_exc() would output “None” when called with no
exception set. However print_exc() never worked like this in Python 3, and
the use case is not documented.
Restore TracebackCases class name (instead of SyntaxTracebackCases), because
the class also tests other exceptions.
|
| |
| |
| |
| | |
but not in the expressions. Also, require expressions to begin and end with literal curly braces.
|
| |
| |
| |
| | |
before beta 2. I also need to look in to why test_tools/test_unparse fails with the files that are now being skipped.
|
| |
| |
| |
| | |
temporary restriction. In 3.6 beta 2, the plan is to again allow backslashes in the string parts of f-strings, but disallow them in the expression parts.
|
| |
| |
| |
| |
| |
| |
| |
| | |
Large sections of repeated lines in tracebacks are now abbreviated as
"[Previous line repeated {count} more times]" by both the traceback
module and the builtin traceback rendering.
Patch by Emanuel Barry.
|
|\ \
| |/ |
|
| |
| |
| |
| | |
Most fixes to Doc/ and Lib/ directories by Ville Skyttä.
|
|\ \
| |/ |
|
| | |
|
|\ \
| |/
| |
| | |
format_stack(), and extract_stack() called without arguments.
|
| |
| |
| |
| | |
format_stack(), and extract_stack() called without arguments.
|
|/
|
|
| |
Minor cleanup patch from Berker Peksag.
|
|
|
|
|
| |
If exc_traceback is None we shouldn't print a traceback header
like described in the documentation.
|
|
|
|
| |
Based on patch by Dmitry Kazakov.
|
| |
|
| |
|
| |
|
|
|
|
|
|
|
|
|
|
|
|
|
| |
The code module was using a private function from traceback in order to skip a
frame - used the direct interface to do that instead,
The decimal module suffered minor fallout from formatting changes ('None' as a
value is now not printed by traceback, the same as None was not before).
The cgitb module was passing a bogus exception type (type.__name__) into
format_exception, which uncovered that format_exception and print_exception had
been ignoring the etype for some time, so the compatibility thunk to the new
code now does the same thing.
|
|
|
|
|
|
|
|
|
| |
Provide a way to seed the linecache for a PEP-302 module without actually
loading the code.
Provide a new object API for traceback, including the ability to not lookup
lines at all until the traceback is actually rendered, without any trace of the
original objects being kept alive.
|
|
|
|
| |
fully qualified class names of Python implemented classes.
|
|\
| |
| |
| | |
IndentationError.
|
| |
| |
| |
| | |
IndentationError.
|
|\ \
| |/ |
|
| | |
|
| |
| |
| |
| | |
by a traceback
|
| |
| |
| |
| | |
Patch by Martin Morrison.
|