summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_traceback.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-45614: Fix traceback display for exceptions with invalid module name ↵Irit Katriel2021-11-291-0/+11
| | | | | (GH-29726) (GH-29827) (cherry picked from commit 4dfae6f38e1720ddafcdd68043e476ecb41cb4d5)
* [3.9] bpo-45083: Include the exception class qualname when formatting an ↵Miss Islington (bot)2021-09-031-0/+13
| | | | | | | | | | | exception (GH-28119) (GH-28135) * bpo-45083: Include the exception class qualname when formatting an exception (GH-28119) Co-authored-by: Erlend Egeberg Aasland <erlend.aasland@innova.no> (cherry picked from commit b4b6342848ec0459182a992151099252434cc619) Co-authored-by: Irit Katriel <1055913+iritkatriel@users.noreply.github.com> Co-authored-by: Łukasz Langa <lukasz@langa.pl>
* [3.9] bpo-43048: RecursionError traceback RecursionError bugfix for cpy3.9 ↵Vladimir Feinberg2021-07-121-0/+37
| | | | | (GH-24460) (#24460) Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* bpo-34463: Make python tracebacks identical to C tracebacks for SyntaxErrors ↵Miss Islington (bot)2020-12-221-0/+25
| | | | | | | without a lineno (GH-23427) (cherry picked from commit 069560b1171eb6385121ff3b6331e8814a4e7454) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* [3.9] bpo-42482: remove reference to exc_traceback from TracebackException ↵Miss Islington (bot)2020-12-041-0/+22
| | | | | | | | (GH-23531) (GH-23578) (cherry picked from commit 427613f005f0f412d12f0d775d2b609bae0ae1ad) Co-authored-by: Irit Katriel <iritkatriel@yahoo.com>
* [3.9] bpo-42474: test TracebackException comparison to non-equal instances ↵Irit Katriel2020-11-301-2/+39
| | | | (GH-23557)
* 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.
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-2/+5
|\
| * Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-2/+5
| |
* | Issue #17825: Cursor ^ is correctly positioned for SyntaxError and ↵Florent Xicluna2014-01-221-4/+14
|\ \ | |/ | | | | IndentationError.
| * Issue #17825: Cursor ^ is correctly positioned for SyntaxError and ↵Florent Xicluna2014-01-221-4/+14
| | | | | | | | IndentationError.
* | Issue #2382: SyntaxError cursor "^" now is written at correct position in mostSerhiy Storchaka2014-01-211-0/+9
|\ \ | |/ | | | | | | cases when multibyte characters are in line (before "^"). This still not works correctly with wide East Asian characters.
| * Issue #2382: SyntaxError cursor "^" now is written at correct position in mostSerhiy Storchaka2014-01-211-0/+9
| | | | | | | | | | cases when multibyte characters are in line (before "^"). This still not works correctly with wide East Asian characters.
* | Do not reset the line number because we already set file position to correctSerhiy Storchaka2014-01-091-0/+4
|\ \ | |/ | | | | | | | | value. (fixes error in patch for issue #18960)