summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* bpo-33930: Fix typo in the test name. (GH-27735)Miss Islington (bot)2021-08-121-1/+1
| | | | | | | | bpo-33930: Fix typo in the test name. (GH-27733) (cherry picked from commit f08e6d1bb3c5655f184af88c6793e90908bb6338) Co-authored-by: Benjamin Peterson <benjamin@python.org> Co-authored-by: Benjamin Peterson <benjamin@python.org>
* [3.8] bpo-33930: Fix segfault with deep recursion when cleaning method ↵Łukasz Langa2021-08-111-0/+15
| | | | | | | objects (GH-27678) (GH-27721) (cherry picked from commit bfc2d5a5c4550ab3a2fadeb9459b4bd948ff61a2) Co-authored-by: Pablo Galindo Salgado <Pablogsal@gmail.com>
* [3.8] [3.9] bpo-41654: Fix deallocator of MemoryError to account for ↵Pablo Galindo2020-09-011-0/+30
| | | | | | | | | | | | | | | subclasses (GH-22020) (GH-22046) When allocating MemoryError classes, there is some logic to use pre-allocated instances in a freelist only if the type that is being allocated is not a subclass of MemoryError. Unfortunately in the destructor this logic is not present so the freelist is altered even with subclasses of MemoryError.. (cherry picked from commit 9b648a95ccb4c3b14f1e87158f5c9f5dbb2f62c0) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>. (cherry picked from commit 87e91ae2e5f81e096c32839f211c68a749a4435a) Co-authored-by: Pablo Galindo <Pablogsal@gmail.com>
* bpo-39219: Fix SyntaxError attributes in the tokenizer. (GH-17828)Miss Islington (bot)2020-02-121-1/+13
| | | | | | | * Always set the text attribute. * Correct the offset attribute for non-ascii sources. (cherry picked from commit 0cc6b5e559b8303b18fdd56c2befd900fe7b5e35) Co-authored-by: Serhiy Storchaka <storchaka@gmail.com>
* Remove unused imports in tests (GH-14518) (GH-14520)Victor Stinner2019-07-011-1/+1
| | | (cherry picked from commit 8f4ef3b019ce380022018587571b0f970e668de3)
* bpo-36829: Add test.support.catch_unraisable_exception() (GH-13490)Victor Stinner2019-05-221-22/+8
| | | | | | * Copy test_exceptions.test_unraisable() to test_sys.UnraisableHookTest(). * Use catch_unraisable_exception() in test_coroutines, test_exceptions, test_generators.
* bpo-31241: Fix AST node position for list and generator comprehensions. ↵Serhiy Storchaka2018-11-271-1/+1
| | | | | | | | (GH-10633) The lineno and col_offset attributes of AST nodes for list comprehensions, generator expressions and tuples are now point to the opening parenthesis or square brace. For tuples without parenthesis they point to the position of the first item.
* bpo-34683: Make SyntaxError column offsets consistently 1-indexed (gh-9338)Ammar Askar2018-09-241-0/+39
| | | | | | Also point to start of tokens in parsing errors. Fixes bpo-34683
* bpo-32489: Allow 'continue' in 'finally' clause. (GH-5822)Serhiy Storchaka2018-03-181-9/+0
|
* Fix miscellaneous typos (#4275)luzpaz2017-11-051-1/+1
|
* bpo-30697: Fix PyErr_NormalizeException() when no memory (GH-2327)xdegaye2017-10-261-2/+101
|
* bpo-30817: Fix PyErr_PrintEx() when no memory (#2526)xdegaye2017-10-231-1/+18
|
* Move exc state to generator. Fixes bpo-25612 (#1773)Mark Shannon2017-10-221-0/+56
| | | Move exception state information from frame objects to coroutine (generator/thread) object where it belongs.
* bpo-31161: only check for parens error for SyntaxError (#3082)Martijn Pieters2017-08-221-0/+28
| | | | Subclasses such as IndentError and TabError should not have this message applied.
* bpo-29951: Include function name for some error messages in ↵Michael Seifert2017-04-091-1/+1
| | | | | | | `PyArg_ParseTuple*` (#916) Also changed format specifier for function name from "%s" to "%.200s" and exception messages should start with lowercase letter.
* bpo-29998: Pickling and copying ImportError now preserves name and path (#1010)Serhiy Storchaka2017-04-081-0/+20
| | | attributes.
* bpo-20548: Use specific asserts in warnings and exceptions tests (#788)Serhiy Storchaka2017-03-301-9/+9
|
* Issue #29507: Update test_exceptionsVictor Stinner2017-02-091-9/+2
| | | | | | | | | | | | | | | | test_unraisable() of test_exceptions expects that PyErr_WriteUnraisable(method) fails on repr(method). Before the previous change (7b8df4a5d81d), slot_tp_finalize() called PyErr_WriteUnraisable() with a PyMethodObject. In this case, repr(method) calls repr(self) which is BrokenRepr.__repr__() and the calls raises a new exception. After the previous change, slot_tp_finalize() uses an unbound method: repr() is called on a regular __del__() method which doesn't call repr(self). repr() doesn't fail anymore. PyErr_WriteUnraisable() doesn't call __repr__() anymore, so remove BrokenRepr unit test.
* Issue #28289: ImportError.__init__ now resets not specified attributes.Serhiy Storchaka2016-09-281-0/+14
|
* Issue #21578: Fixed misleading error message when ImportError called withSerhiy Storchaka2016-09-271-0/+16
|\ | | | | | | invalid keyword args.
| * Issue #21578: Fixed misleading error message when ImportError called withSerhiy Storchaka2016-09-271-0/+17
|/ | | | invalid keyword args.
* Issue #22836: Keep exception reports sensible despite errorsMartin Panter2016-02-281-2/+66
|
* Issue #23391: Merge OSError doc from 3.4 into 3.5Martin Panter2015-10-261-5/+12
|\
| * Issue #23391: Restore OSError constructor argument documentationMartin Panter2015-10-261-5/+12
| | | | | | | | | | | | | | | | | | | | | | | | | | | | This restores details lost in revision 097f4fda61a4 (since Python 3.3, related to the new OSError subclasses). Further additions: * Markup for attributes and constructor signature * Explain "winerror" and "filename2" * Extend test to check for filename2 defaulting to None * Clarify that the constructor can return a subclass I have intentionally left out any details of allowing more than five arguments, or how the "args" attribute is set for four or more arguments. These details seem to be dependent on the Python version and platform.
* | Add a rudimentary test for StopAsyncIteration in test_exceptions.Yury Selivanov2015-07-031-0/+2
| |
* | Issue #19235: Add new RecursionError exception. Patch by Georg Brandl.Yury Selivanov2015-07-031-6/+7
|/
* Issue #22977: Remove unconditional import of ctypes.Serhiy Storchaka2015-04-061-1/+0
|
* Issue #22977: Fix test_exceptionsVictor Stinner2015-04-021-5/+8
|
* Issue #22977: Fixed formatting Windows error messages on Wine.Serhiy Storchaka2015-04-021-1/+9
| | | | Patch by Martin Panter.
* Issue #23353: improve exceptions tests for generatorsAntoine Pitrou2015-03-181-0/+46
|
* make sure to test UnicodeEncodeError, tooBenjamin Peterson2014-04-021-1/+1
|
* bail in unicode error's __str__ methods if the objects are not properly ↵Benjamin Peterson2014-04-021-0/+6
| | | | initialized (closes #21134)
* make test name consistent with the rest of the fileBenjamin Peterson2014-04-021-1/+1
|
* Issue #20517: Functions in the os module that accept two filenamesLarry Hastings2014-02-101-2/+2
| | | | | | now register both filenames in the exception on failure. This required adding new C API functions allowing OSError exceptions to reference two filenames instead of one.
* Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-0/+2
|\
| * Issue #20532: Tests which use _testcapi now are marked as CPython only.Serhiy Storchaka2014-02-071-0/+2
| |
| * Silence BytesWarning (backport 267a4d4d9d65).Serhiy Storchaka2014-02-061-5/+6
| |
* | Issue #2382: SyntaxError cursor "^" now is written at correct position in mostSerhiy Storchaka2014-01-211-0/+13
|\ \ | |/ | | | | | | 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/+13
| | | | | | | | | | cases when multibyte characters are in line (before "^"). This still not works correctly with wide East Asian characters.
* | Remove dead code in test_exceptions.Brett Cannon2013-07-041-3/+0
| |
* | Issue #15767: back out 8a0ed9f63c6e, finishing the removal ofBrett Cannon2013-07-041-0/+3
| | | | | | | | ModuleNotFoundError.
* | Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-121-3/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | ImportError. The exception is raised by import when a module could not be found. Technically this is defined as no viable loader could be found for the specified module. This includes ``from ... import`` statements so that the module usage is consistent for all situations where import couldn't find what was requested. This should allow for the common idiom of:: try: import something except ImportError: pass to be updated to using ModuleNotFoundError and not accidentally mask ImportError messages that should propagate (e.g. issues with a loader). This work was driven by the fact that the ``from ... import`` statement needed to be able to tell the difference between an ImportError that simply couldn't find a module (and thus silence the exception so that ceval can raise it) and an ImportError that represented an actual problem.
* | Replace IOError with OSError (#16715)Andrew Svetlov2012-12-251-4/+4
| |
* | Get rig of EnvironmentError (#16705)Andrew Svetlov2012-12-171-3/+3
| |
* | merge 3.3Philip Jenvey2012-11-141-5/+10
|\ \ | |/
| * merge 3.2Philip Jenvey2012-11-141-5/+10
| |\
| | * don't gc_collect on CPython to guarantee a lack of ref cycles (thanks Antoine)Philip Jenvey2012-11-141-5/+9
| | |
* | | merge 3.3Philip Jenvey2012-11-131-0/+3
|\ \ \ | |/ /
| * | merge 3.2Philip Jenvey2012-11-131-0/+3
| |\ \ | | |/
| | * add gc_collects to weakref testsPhilip Jenvey2012-11-131-0/+3
| | |