summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.10] bpo-44446: support lineno being None in traceback.FrameSummary ↵Pablo Galindo2021-07-081-0/+4
| | | | | | | | | | | | | (GH-26781) (GH-27072) As of 088a15c49d99ecb4c3bef93f8f40dd513c6cae3b, lineno is None instead of -1 if there is no line number. Signed-off-by: Filipe Laíns <lains@riseup.net>. (cherry picked from commit 91a8f8c16ca9a7e2466a8241d9b41769ef97d094) Co-authored-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Filipe Laíns <lains@riseup.net>
* bpo-43024: improve signature (in help, etc) for functions taking sent… ↵Miss Islington (bot)2021-06-171-0/+16
| | | | | | | | (GH-24331) (GH-26773) …inel defaults (cherry picked from commit f73377d57c5272390de63cccc3c292c44689310a) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com>
* bpo-43146: fix None-handling in single-arg traceback.print_exception(None) ↵Irit Katriel2021-02-231-0/+5
| | | | | (GH-24629) (The previous commit fixed print_exception(None, None, None).)
* bpo-43146: fix regression in traceback.print_exception(None) (GH-24463)Irit Katriel2021-02-231-0/+18
|
* bpo-42877: add the 'compact' param to TracebackException's __init__ (#24179)Irit Katriel2021-01-151-0/+40
| | | Use it to reduce the time and memory taken up by several of traceback's module-level functions.
* bpo-42848: remove recursion from TracebackException (GH-24158)Irit Katriel2021-01-121-0/+25
|
* bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors ↵Irit Katriel2020-12-221-0/+25
| | | | without a lineno (GH-23427)
* bpo-42482: remove reference to exc_traceback from TracebackException (GH-23531)Irit Katriel2020-12-011-0/+22
|
* bpo-42474: test TracebackException comparison to non-equal instances (GH-23522)Irit Katriel2020-11-271-2/+39
| | | Closes bpo-42474
* bpo-26389: Allow passing an exception object in the traceback module (GH-22610)Zackery Spytz2020-11-051-0/+20
| | | | | | 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>
* bpo-41521: Replace whitelist/blacklist with allowlist/denylist (GH-21822)Victor Stinner2020-08-111-2/+2
| | | Automerge-Triggered-By: @tiran
* bpo-40275: Use new test.support helper submodules in tests (GH-21317)Hai Shi2020-07-061-1/+2
|
* bpo-40939: Remove the old parser (GH-20768)Pablo Galindo2020-06-111-1/+0
| | | This commit removes the old parser, the deprecated parser module, the old parser compatibility flags and environment variables and all associated support code and documentation.
* bpo-40612: Fix SyntaxError edge cases in traceback formatting (GH-20072)Guido van Rossum2020-05-151-8/+26
| | | | | | | | | | | | | 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
* bpo-40334: Rename PyConfig.use_peg to _use_peg_parser (GH-19670)Victor Stinner2020-04-231-2/+1
| | | | | | | | | | | * Rename PyConfig.use_peg to _use_peg_parser * Document PyConfig._use_peg_parser and mark it a deprecated * Mark -X oldparser option and PYTHONOLDPARSER env var as deprecated in the documentation. * Add use_old_parser() and skip_if_new_parser() to test.support * Remove sys.flags.use_peg: use_old_parser() uses _testinternalcapi.get_configs() instead. * Enhance test_embed tests * subprocess._args_from_interpreter_flags() copies -X oldparser
* bpo-40334: PEP 617 implementation: New PEG parser for CPython (GH-19503)Pablo Galindo2020-04-221-0/+2
| | | | Co-authored-by: Guido van Rossum <guido@python.org> Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* bpo-39489: Remove COUNT_ALLOCS special build (GH-18259)Victor Stinner2020-02-031-1/+0
| | | | | | | | | | | Remove: * COUNT_ALLOCS macro * sys.getcounts() function * SHOW_ALLOC_COUNT code in listobject.c * SHOW_TRACK_COUNT code in tupleobject.c * PyConfig.show_alloc_count field * -X showalloccount command line option * @test.support.requires_type_collecting decorator
* Remove binding of captured exceptions when not used to reduce the chances of ↵Pablo Galindo2019-11-191-5/+5
| | | | | | | creating cycles (GH-17246) Capturing exceptions into names can lead to reference cycles though the __traceback__ attribute of the exceptions in some obscure cases that have been reported previously and fixed individually. As these variables are not used anyway, we can remove the binding to reduce the chances of creating reference cycles. See for example GH-13135
* bpo-37685: Fixed __eq__, __lt__ etc implementations in some classes. (GH-14952)Serhiy Storchaka2019-08-081-1/+15
| | | | They now return NotImplemented for unsupported type of the other operand.
* bpo-35202: Remove unused imports in tests. (GH-10561)Srinivas Thatiparthy (శ్రీనివాస్ తాటిపర్తి)2018-11-161-1/+1
|
* bpo-12458: Fix line numbers for multiline expressions. (GH-8774)Serhiy Storchaka2018-09-171-2/+2
|
* bpo-26502: Implement FrameSummary.__len__() (GH-8632)Berker Peksag2018-09-101-0/+5
|
* bpo-34588: Fix an off-by-one error in traceback formatting. (GH-9077)Benjamin Peterson2018-09-101-2/+59
| | | | | | | | 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.
* bpo-28603: Fix formatting tracebacks for unhashable exceptions (#4014)Zane Bitter2017-10-171-0/+46
|
* bpo-30445: Allow appended output in RecursionError messagecodedragon2017-05-241-1/+2
| | | | | Running under coverage sometimes causes 'in comparison' to be added to the end of the RecursionError message, which is acceptable. Patched by Maria Mckinley
* Issue #25783: Fixed test_traceback when run directly (without regrtest).Serhiy Storchaka2016-10-071-2/+6
|\
| * Issue #25783: Fixed test_traceback when run directly (without regrtest).Serhiy Storchaka2016-10-071-2/+6
| |
* | Issue #27348: Merge exception formatting fix from 3.5 into 3.6Martin Panter2016-09-221-5/+12
|\ \ | |/
| * Issue #27348: Restore “Exception: None” formatting in traceback moduleMartin Panter2016-09-221-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* | Issue #27213: Fixed different issues with reworked CALL_FUNCTION* opcodes.Serhiy Storchaka2016-09-111-2/+1
| | | | | | | | | | | | | | | | | | | | | | * BUILD_TUPLE_UNPACK and BUILD_MAP_UNPACK_WITH_CALL no longer generated with single tuple or dict. * Restored more informative error messages for incorrect var-positional and var-keyword arguments. * Removed code duplications in _PyEval_EvalCodeWithName(). * Removed redundant runtime checks and parameters in _PyStack_AsDict(). * Added a workaround and enabled previously disabled test in test_traceback. * Removed dead code from the dis module.
* | Issue 27948: Allow backslashes in the literal string portion of f-strings, ↵Eric V. Smith2016-09-101-14/+14
| | | | | | | | but not in the expressions. Also, require expressions to begin and end with literal curly braces.
* | Rework CALL_FUNCTION* opcodesVictor Stinner2016-09-091-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | Issue #27213: Rework CALL_FUNCTION* opcodes to produce shorter and more efficient bytecode: * CALL_FUNCTION now only accepts position arguments * CALL_FUNCTION_KW accepts position arguments and keyword arguments, but keys of keyword arguments are packed into a constant tuple. * CALL_FUNCTION_EX is the most generic, it expects a tuple and a dict for positional and keyword arguments. CALL_FUNCTION_VAR and CALL_FUNCTION_VAR_KW opcodes have been removed. 2 tests of test_traceback are currently broken: skip test, the issue #28050 was created to track the issue. Patch by Demur Rumed, design by Serhiy Storchaka, reviewed by Serhiy Storchaka and Victor Stinner.
* | Issue 27921: Remove backslash from another f-string. I'll revert this change ↵Eric V. Smith2016-09-031-14/+14
| | | | | | | | before beta 2.
* | Issue #26823: Abbreviate recursive tracebacksNick Coghlan2016-08-151-0/+131
| | | | | | | | | | | | | | | | 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.
* | Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+1
|\ \ | |/
| * Issue #19527: Fixed tests with defined COUNT_ALLOCS.Serhiy Storchaka2016-07-031-0/+1
| |
* | Additional grammar fixMartin Panter2016-04-191-1/+1
| |
* | Replace noop constant statement with expressionVictor Stinner2016-02-081-7/+7
|/ | | | | | | | | | * Constant statements will be ignored and the compiler will emit a SyntaxWarning. * Replace constant statement (ex: "1") with an expression statement (ex: "x=1"). * test_traceback: use context manager on the file. Issue #26204.
* Issue #25111: Fixed comparison of traceback.FrameSummary.Serhiy Storchaka2015-09-291-5/+11
|
* Issue #25108: Omitted internal frames in traceback functions print_stack(),Serhiy Storchaka2015-09-181-0/+35
| | | | format_stack(), and extract_stack() called without arguments.
* Issue #24695: Fix a regression in traceback.print_exception()Berker Peksag2015-07-241-0/+13
| | | | | If exc_traceback is None we shouldn't print a traceback header like described in the documentation.
* Issue #9517: Move script_helper to the support package.Berker Peksag2015-05-061-1/+1
| | | | Patch by Christie Wilson.
* Issue #22619: Added negative limit support in the traceback module.Serhiy Storchaka2015-05-031-4/+123
| | | | Based on patch by Dmitry Kazakov.
* Issue #23883: Add missing entries to traceback.__all__.Berker Peksag2015-04-081-7/+16
|
* Issue #23631: Fix traceback.format_list when a traceback has been mutated.Robert Collins2015-03-161-1/+9
|
* Issue #22936: Make it possible to show local variables in tracebacks.Robert Collins2015-03-051-8/+60
|
* Fix brownbag in issue 17911 commitRobert Collins2015-03-041-3/+2
|
* Issue #17911: traceback module overhaulRobert Collins2015-03-041-0/+196
| | | | | | | | | 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.
* (Merge 3.4) Issue #22599: Enhance tokenize.open() to be able to call it duringVictor Stinner2014-12-051-0/+33
|\ | | | | | | | | | | | | | | | | | | | | | | | | Python finalization. Before the module kept a reference to the builtins module, but the module attributes are cleared during Python finalization. Instead, keep directly a reference to the open() function. This enhancement is not perfect, calling tokenize.open() can still fail if called very late during Python finalization. Usually, the function is called by the linecache module which is called to display a traceback or emit a warning.
* | Issue #22032: __qualname__ instead of __name__ is now always used to formatSerhiy Storchaka2014-07-221-2/+2
|/ | | | fully qualified class names of Python implemented classes.