summaryrefslogtreecommitdiffstats
path: root/Lib/test/test_exceptions.py
Commit message (Collapse)AuthorAgeFilesLines
* 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
| | |
* | | Clean up some warnings in test suite output.Nadeem Vawda2012-10-131-4/+5
|/ /
* | Issue #15784: Modify OSError.__str__() to better distinguish betweenRichard Oudkerk2012-08-281-2/+2
| | | | | | | | errno error numbers and Windows error numbers.
* | Issue #15778: Coerce ImportError.args to a string when it isn'tBrett Cannon2012-08-241-0/+5
| | | | | | | | | | | | already one. Patch by Dave Malcolm.
* | Issue #1692335: Move initial args assignment to BaseException.__new__Richard Oudkerk2012-07-281-1/+15
| | | | | | | | to help pickling of naive subclasses.
* | PEP 415: Implement suppression of __context__ display with an exception ↵Benjamin Peterson2012-05-151-7/+8
| | | | | | | | | | | | attribute This replaces the original PEP 409 implementation. See #14133.
* | Issue #1559549: Add 'name' and 'path' attributes to ImportError.Brett Cannon2012-04-131-1/+23
| | | | | | | | | | | | | | | | Currently import does not use these attributes as they are planned for use by importlib (which will be another commit). Thanks to Filip Gruszczyński for the initial patch and Brian Curtin for refining it.
* | - Issue #14177: marshal.loads() now raises TypeError when given an unicodeAntoine Pitrou2012-03-031-1/+1
|\ \ | |/ | | | | string. Patch by Guilherme Gonçalves.
| * Issue #14177: marshal.loads() now raises TypeError when given an unicode string.Antoine Pitrou2012-03-031-1/+1
| | | | | | | | Patch by Guilherme Gonçalves.
* | Close issue #6210: Implement PEP 409Nick Coghlan2012-02-261-6/+23
| |
* | PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.Antoine Pitrou2011-10-121-9/+34
| |
* | Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is nowAntoine Pitrou2011-09-011-0/+8
|\ \ | |/ | | | | mapped to POSIX errno ENOTDIR (previously EINVAL).
| * Issue #12802: the Windows error ERROR_DIRECTORY (numbered 267) is nowAntoine Pitrou2011-09-011-0/+8
| | | | | | | | mapped to POSIX errno ENOTDIR (previously EINVAL).
* | Issue #12791: Break reference cycles early when a generator exits with an ↵Antoine Pitrou2011-08-201-0/+62
|\ \ | |/ | | | | exception.
| * Issue #12791: Break reference cycles early when a generator exits with an ↵Antoine Pitrou2011-08-201-0/+62
| | | | | | | | exception.
* | merge 3.2Benjamin Peterson2011-07-031-0/+12
|\ \ | |/
| * never retain a generator's caller's exception state on the generator after a ↵Benjamin Peterson2011-07-031-0/+12
| | | | | | | | | | | | | | yield/return This requires some trickery to properly save the exception state if the generator creates its own exception state.
* | merge 3.2 (#12475)Benjamin Peterson2011-07-031-0/+15
|\ \ | |/
| * restore a generator's caller's exception state both on yield and (last) returnBenjamin Peterson2011-07-031-0/+15
| | | | | | | | | | | | This prevents generator exception state from leaking into the caller. Closes #12475.
* | Issue #10990: Prevent tests from clobbering a set trace function.Brett Cannon2011-02-211-1/+4
|/ | | | | | | | | | | Many tests simply didn't care if they unset a pre-existing trace function. This made test coverage impossible. This patch fixes various tests to put back any pre-existing trace function. It also introduces test.support.no_tracing as a decorator which will temporarily unset the trace function for tests which simply fail otherwise. Thanks to Kristian Vlaardingerbroek for helping to find the cause of various trace function unsets.
* #9424: Replace deprecated assert* methods in the Python test suite.Ezio Melotti2010-11-201-30/+29
|
* Issue #5437: A preallocated MemoryError instance should not hold tracebackAntoine Pitrou2010-10-281-0/+39
| | | | data (including local variables caught in the stack trace) alive infinitely.
* #4617: Previously it was illegal to delete a name from the localAmaury Forgeot d'Arc2010-09-101-0/+11
| | | | | | | | | | | | | | | | | | | | | | | | | | | | namespace if it occurs as a free variable in a nested block. This limitation of the compiler has been lifted, and a new opcode introduced (DELETE_DEREF). This sample was valid in 2.6, but fails to compile in 3.x without this change:: >>> def f(): ... def print_error(): ... print(e) ... try: ... something ... except Exception as e: ... print_error() ... # implicit "del e" here This sample has always been invalid in Python, and now works:: >>> def outer(x): ... def inner(): ... return x ... inner() ... del x There is no need to bump the PYC magic number: the new opcode is used for code that did not compile before.
* Merged revisions 82330 via svnmerge fromBenjamin Peterson2010-06-281-1/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82330 | benjamin.peterson | 2010-06-28 10:36:40 -0500 (Mon, 28 Jun 2010) | 1 line testcapi tests are definitely cpython only ........
* prevent generator finalization from invalidating sys.exc_info() #7173Benjamin Peterson2010-03-071-1/+16
|
* Merged revisions 78418 via svnmerge fromEric Smith2010-02-241-0/+36
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r78418 | eric.smith | 2010-02-24 09:15:36 -0500 (Wed, 24 Feb 2010) | 1 line Issue #7309: Unchecked pointer access when converting UnicodeEncodeError, UnicodeDecodeError, and UnicodeTranslateError to strings. ........
* Merged revisions 77727 via svnmerge fromEzio Melotti2010-01-241-3/+3
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77727 | ezio.melotti | 2010-01-24 18:58:36 +0200 (Sun, 24 Jan 2010) | 1 line use assert[Not]IsInstance where appropriate ........
* use assert[Not]In where appropriateEzio Melotti2010-01-231-1/+1
|
* use assert[Not]In where appropriateBenjamin Peterson2010-01-191-2/+2
| | | | A patch from Dave Malcolm.
* Merged revisions 77088 via svnmerge fromGeorg Brandl2009-12-281-0/+40
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r77088 | georg.brandl | 2009-12-28 09:34:58 +0100 (Mo, 28 Dez 2009) | 1 line #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new exceptions a docstring. ........
* Remove test for unicode(e) converted to str(e) by 2to3Ezio Melotti2009-12-241-5/+3
|