summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* [3.12] gh-109894: Fix initialization of static `MemoryError` in ↵Miss Islington (bot)2023-11-281-0/+14
| | | | | | | | | | | | | | | subinterpreter (gh-110911) (gh-111238) Fixes GH-109894 * set `interp.static_objects.last_resort_memory_error.args` to empty tuple to avoid crash on `PyErr_Display()` call * allow `_PyExc_InitGlobalObjects()` to be called on subinterpreter init --------- (cherry picked from commit 47d3e2ed930a9f3d228aed4f62133737dae74cf7) Co-authored-by: Radislav Chugunov <52372310+chgnrdv@users.noreply.github.com> Co-authored-by: blurb-it[bot] <43283697+blurb-it[bot]@users.noreply.github.com>
* [3.12] gh-111654: remove redundant decref in LOAD_FROM_DICT_OR_DEREF ↵Jelle Zijlstra2023-11-031-0/+7
| | | | | | | (GH-111655) (#111674) (cherry picked from commit 3a1b09e6d070778d78d81084f88d37377d38ee9b) Co-authored-by: AN Long <aisk@users.noreply.github.com>
* [3.12] gh-107450: Check for overflow in the tokenizer and fix overflow test ↵Lysandros Nikolaou2023-10-161-4/+12
| | | | | | | | | (GH-110832) (#110931) (cherry picked from commit a1ac5590e0f8fe008e5562d22edab65d0c1c5507) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Filipe Laíns <lains@riseup.net> Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* [3.12] gh-107450: Fix parser column offset overflow test on Windows ↵Miss Islington (bot)2023-10-131-2/+4
| | | | | | | | (GH-110768) (#110808) (cherry picked from commit 05439d308740b621d03562451a7608eb725937ae) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Nikita Sobolev <mail@sobolevn.me>
* [3.12] gh-107450: Raise OverflowError when parser column offset overflows ↵Miss Islington (bot)2023-10-121-0/+4
| | | | | | | (GH-110754) (#110762) (cherry picked from commit fb7843ee895ac7f6eeb58f356b1a320eea081cfc) Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com>
* [3.12] gh-108416: Mark slow test methods with @requires_resource('cpu') ↵Miss Islington (bot)2023-09-021-0/+1
| | | | | | | | | | | | (GH-108421) (#108798) gh-108416: Mark slow test methods with @requires_resource('cpu') (GH-108421) Only mark tests which spend significant system or user time, by itself or in subprocesses. (cherry picked from commit f3ba0a74cd50274acdcd592d4ce8395b92492b7c) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* gh-103333: Pickle the keyword attributes of AttributeError (#103352)Charles Machalow2023-05-121-27/+34
| | | | | | * Pickle the `name` and `args` attributes of AttributeError when present. Co-authored-by: Gregory P. Smith <greg@krypto.org> Co-authored-by: Erlend E. Aasland <erlend.aasland@protonmail.com>
* gh-102856: Initial implementation of PEP 701 (#102855)Pablo Galindo Salgado2023-04-191-1/+2
| | | | | | Co-authored-by: Lysandros Nikolaou <lisandrosnik@gmail.com> Co-authored-by: Batuhan Taskaya <isidentical@gmail.com> Co-authored-by: Marta Gómez Macías <mgmacias@google.com> Co-authored-by: sunmy2019 <59365878+sunmy2019@users.noreply.github.com>
* gh-102799: use sys.exception() instead of sys.exc_info() in tests (#103293)Irit Katriel2023-04-061-34/+32
|
* gh-89058: remove skip from test_no_hang_on_context_chain_cycle2 (#102903)Irit Katriel2023-04-051-1/+0
|
* gh-102799: remove unnecessary calls to sys.exc_info() in tests (#102800)Irit Katriel2023-03-181-9/+9
|
* GH-101578: Normalize the current exception (GH-101607)Mark Shannon2023-02-081-4/+4
| | | | | | | | | | * Make sure that the current exception is always normalized. * Remove redundant type and traceback fields for the current exception. * Add new API functions: PyErr_GetRaisedException, PyErr_SetRaisedException * Add new API functions: PyException_GetArgs, PyException_SetArgs
* gh-99482: remove `jython` compatibility parts from stdlib and tests (#99484)Nikita Sobolev2022-12-231-4/+3
|
* GH-91079: Decouple C stack overflow checks from Python recursion checks. ↵Mark Shannon2022-10-051-6/+2
| | | | (GH-96510)
* gh-97008: Add a Python implementation of AttributeError and NameError ↵Łukasz Langa2022-10-041-500/+3
| | | | | | | | | suggestions (#97022) Relevant tests moved from test_exceptions to test_traceback to be able to compare both implementations. Co-authored-by: Carl Friedrich Bolz-Tereick <cfbolz@gmx.de>
* gh-96352: Set AttributeError context in _PyObject_GenericGetAttrWithDict ↵philg3142022-09-081-0/+5
| | | | (#96353)
* Increase test coverage of Objects/exceptions.c (GH-94674)Irit Katriel2022-07-081-5/+47
|
* gh-84623: Remove unused imports in tests (#93772)Victor Stinner2022-06-131-1/+0
|
* GH-88116: Use a compact format to represent end line and column offsets. ↵Mark Shannon2022-04-211-1/+1
| | | | | | | | | | | | (GH-91666) * Stores all location info in linetable to conform to PEP 626. * Remove column table from code objects. * Remove end-line table from code objects. * Document new location table format
* gh-89770: Implement PEP-678 - Exception notes (GH-31317)Irit Katriel2022-04-161-13/+19
|
* bpo-47212: Improve error messages for un-parenthesized generator expressions ↵Matthieu Dartiailh2022-04-051-1/+10
| | | | (GH-32302)
* bpo-46940: Don't override existing AttributeError suggestion information ↵Pablo Galindo Salgado2022-03-071-0/+18
| | | | | | | | | | | | (GH-31710) When an exception is created in a nested call to PyObject_GetAttr, any external calls will override the context information of the AttributeError that we have already placed in the most internal call. This will cause the suggestions we create to nor work properly as the attribute name and object that we will be using are the incorrect ones. To avoid this, we need to check first if these attributes are already set and bail out if that's the case.
* Allow the parser to avoid nested processing of invalid rules (GH-31252)Pablo Galindo Salgado2022-02-101-1/+1
|
* bpo-46458: Add tests for context of exception in finally block (GH-30986)Irit Katriel2022-01-281-0/+50
|
* bpo-46442: improve and rename testExceptionCleanupNames (GH-30758)Yellow Dusk2022-01-221-2/+14
| | | | | The test tested that explicitly deleting the local variable bound to the exception did not cause problems, but it did not test what it actually claimed to test, i.e. that the variable is deleted automatically.
* bpo-46339: Fix crash in the parser when computing error text for multi-line ↵Pablo Galindo Salgado2022-01-111-0/+6
| | | | | f-strings (GH-30529) Automerge-Triggered-By: GH:pablogsal
* bpo-46237: Fix the line number of tokenizer errors inside f-strings (GH-30463)Pablo Galindo Salgado2022-01-081-0/+12
|
* bpo-46240: Correct the error for unclosed parentheses when the tokenizer is ↵Pablo Galindo Salgado2022-01-041-1/+1
| | | | not finished (GH-30378)
* bpo-45292: [PEP-654] add except* (GH-29581)Irit Katriel2021-12-141-0/+2
|
* bpo-46054: Correct non-utf8 character tests in test_exceptions (GH-30074)Pablo Galindo Salgado2021-12-121-2/+2
|
* bpo-46054: Fix parsing error when parsing non-utf8 characters in source ↵Pablo Galindo Salgado2021-12-121-0/+12
| | | | files (GH-30068)
* bpo-46042: Improve SyntaxError locations in the symbol table (GH-30059)Pablo Galindo Salgado2021-12-111-3/+4
|
* bpo-46004: Fix error location for loops with invalid targets (GH-29959)Pablo Galindo Salgado2021-12-071-0/+1
|
* bpo-45607: Make it possible to enrich exception displays via setting their ↵Irit Katriel2021-12-031-0/+21
| | | | __note__ field (GH-29880)
* bpo-45786: Allocate space for frame in frame object. (GH-29729)Mark Shannon2021-11-291-4/+2
|
* bpo-45727: Only trigger the 'did you forgot a comma' error suggestion if ↵Pablo Galindo Salgado2021-11-241-2/+2
| | | | inside parentheses (GH-29757)
* bpo-45871: Refactor except matcher validation into a separate function so ↵Irit Katriel2021-11-221-0/+15
| | | | that it can be reused. Add missing unit test. (GH-29711)
* bpo-45848: Allow the parser to get error lines from encoded files (GH-29646)Pablo Galindo Salgado2021-11-201-0/+13
|
* bpo-45727: Make the syntax error for missing comma more consistent (GH-29427)Pablo Galindo Salgado2021-11-191-0/+1
|
* bpo-45826: Fix a crash in suggestions.c by checking for `traceback is None` ↵Dennis Sweeney2021-11-171-0/+31
| | | | (GH-29590)
* bpo-45494: Fix parser crash when reporting errors involving invalid ↵Pablo Galindo Salgado2021-10-191-0/+4
| | | | | | | | | | | | continuation characters (GH-28993) There are two errors that this commit fixes: * The parser was not correctly computing the offset and the string source for E_LINECONT errors due to the incorrect usage of strtok(). * The parser was not correctly unwinding the call stack when a tokenizer exception happened in rules involving optionals ('?', [...]) as we always make them return valid results by using the comma operator. We need to check first if we don't have an error before continuing.
* bpo-45408: Don't override previous tokenizer errors in the second parser ↵Pablo Galindo Salgado2021-10-071-1/+1
| | | | pass (GH-28812)
* bpo-45400: Fix suggestion test of test_exceptions (GH-28783)Victor Stinner2021-10-071-1/+1
| | | | | Fix test_name_error_suggestions_do_not_trigger_for_too_many_locals() of test_exceptions if a directory name contains "a1" (like "Python-3.11.0a1"): use a stricter regular expression.
* Fix typos in the Lib directory (GH-28775)Christian Clauss2021-10-061-1/+1
| | | | | Fix typos in the Lib directory as identified by codespell. Co-authored-by: Terry Jan Reedy <tjreedy@udel.edu>
* [tests] Add missing assert against expected tracebacks in test_exceptions.py ↵andrei kulakov2021-09-211-0/+1
| | | | (GH-28484)
* bpo-25130: Add calls of gc.collect() in tests to support PyPy (GH-28005)Serhiy Storchaka2021-08-291-0/+10
|
* bpo-44895: skip test_no_hang_on_context_chain_cycle2 until the refleak is ↵Irit Katriel2021-08-161-3/+1
| | | | fixed (GH-27761)
* bpo-44895: Temporarily add an extra gc.collect() call (GH-27746)Irit Katriel2021-08-131-0/+3
| | | This is part of an investigation of a non-deterministic reference leak. While we're looking for the root cause, this is included temporarily so that CI doesn't fail on this particular issue. This enables it to find other regressions in the meantime, which would otherwise be shadowed by our known issue.
* bpo-33930: Fix typo in the test name. (#27733)Benjamin Peterson2021-08-121-1/+1
| | | bpo-33930: Fix typo in the test name. (GH-27733)
* bpo-33930: Fix segfault with deep recursion when cleaning method objects ↵Pablo Galindo Salgado2021-08-101-0/+15
| | | | (GH-27678)