summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #15767: back out 8a0ed9f63c6e, finishing the removal ofBrett Cannon2013-07-041-9/+0
| | | | ModuleNotFoundError.
* Issue #15767: Introduce ModuleNotFoundError, a subclass ofBrett Cannon2013-06-121-0/+9
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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.
* Issue #17591: Use lowercase filenames when including Windows header files.Antoine Pitrou2013-03-311-1/+1
| | | | Patch by Roumen Petrov.
* 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-1/+1
| | | | | | already one. Patch by Dave Malcolm.
* Issue #1692335: Move initial args assignment to BaseException.__new__Richard Oudkerk2012-07-281-1/+10
| | | | to help pickling of naive subclasses.
* Issue #15229: An OSError subclass whose __init__ doesn't call backAntoine Pitrou2012-06-301-0/+6
| | | | | OSError.__init__ could produce incomplete instances, leading to crashes when calling str() on them.
* Issue #13783: the PEP 380 implementation no longer expands the public C APINick Coghlan2012-06-171-6/+0
|
* Fix build failure.Antoine Pitrou2012-05-161-1/+2
|
* PEP 415: Implement suppression of __context__ display with an exception ↵Benjamin Peterson2012-05-151-19/+20
| | | | | | attribute This replaces the original PEP 409 implementation. See #14133.
* Fix #13210. Port the Windows build from VS2008 to VS2010.Brian Curtin2012-05-131-0/+28
|
* Issue #2377: Make importlib the implementation of __import__().Brett Cannon2012-04-141-6/+2
| | | | | | | importlib._bootstrap is now frozen into Python/importlib.h and stored as _frozen_importlib in sys.modules. Py_Initialize() loads the frozen code along with sys and imp and then uses _frozen_importlib._install() to set builtins.__import__() w/ _frozen_importlib.__import__().
* Issue #1559549: Add 'name' and 'path' attributes to ImportError.Brett Cannon2012-04-131-2/+97
| | | | | | | | 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.
* Close issue #6210: Implement PEP 409Nick Coghlan2012-02-261-11/+18
|
* use new generic __dict__ descriptor implementationsBenjamin Peterson2012-02-201-31/+1
|
* merge 3.2Benjamin Peterson2012-02-101-1/+1
|\
| * this is only a borrowed ref in Brett's branchBenjamin Peterson2012-02-101-1/+1
| |
* | merge 3.2Benjamin Peterson2012-02-061-1/+0
|\ \ | |/
| * bltinmod is borrowed, so it shouldn't be decrefedBenjamin Peterson2012-02-061-1/+0
| |
* | merge 3.2Benjamin Peterson2012-02-041-5/+10
|\ \ | |/
| * put returns on their own linesBenjamin Peterson2012-02-041-5/+10
| |
* | Fix some of the remaining test_capi leaksAntoine Pitrou2012-01-181-3/+5
| |
* | Fix some of the remaining test_capi refleaksAntoine Pitrou2012-01-181-0/+2
| |
* | Fix some of the refleaks in test_capi (ported from 3.2)Antoine Pitrou2012-01-181-3/+7
|\ \ | |/
| * Fix refleaks in test_capiAntoine Pitrou2012-01-181-3/+7
| | | | | | | | (this was easier than I thought!)
* | Merge refleak fixes from 3.2Antoine Pitrou2012-01-181-21/+23
|\ \ | |/
| * Fix leaking a RuntimeError objects when creating sub-interpretersAntoine Pitrou2012-01-181-21/+23
| |
* | Implement PEP 380 - 'yield from' (closes #11682)Nick Coghlan2012-01-131-2/+64
| |
* | Fix OSError.__init__ and OSError.__new__ so that each of them can beAntoine Pitrou2011-12-151-57/+159
| | | | | | | | overriden and take additional arguments (followup to issue #12555).
* | Fix misuse of PyUnicode_GET_SIZE() => PyUnicode_GET_LENGTH()Victor Stinner2011-11-211-2/+2
| | | | | | | | And PyUnicode_GetSize() => PyUnicode_GetLength()
* | UnicodeTranslateError uses the new Unicode APIVictor Stinner2011-11-211-3/+3
| | | | | | | | The index is a character index, not a index in a Py_UNICODE* string.
* | UnicodeEncodeError uses the new Unicode APIVictor Stinner2011-11-201-3/+3
| | | | | | | | The index is a character index, not a index in a Py_UNICODE* string.
* | Port error handlers from Py_UNICODE indexing to code point indexing.Martin v. Löwis2011-11-041-0/+5
| |
* | PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.Antoine Pitrou2011-10-121-184/+349
| |
* | Fix my_basename(): make the string readyVictor Stinner2011-10-051-2/+7
| |
* | Implement PEP 393.Martin v. Löwis2011-09-281-10/+16
| |
* | SystemExit_init(): avoid an useless testVictor Stinner2011-05-261-1/+1
|/ | | | Make silent a false positive of the Clang Static Analyzer.
* Issue #5437: A preallocated MemoryError instance should not hold tracebackAntoine Pitrou2010-10-281-10/+87
| | | | data (including local variables caught in the stack trace) alive infinitely.
* Add a new warning gategory, ResourceWarning, as discussed on python-dev. It ↵Georg Brandl2010-10-241-0/+10
| | | | | | | | is silent by default, except when configured --with-pydebug. Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
* Merged revisions 82157 via svnmerge fromBenjamin Peterson2010-06-221-3/+0
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r82157 | benjamin.peterson | 2010-06-22 14:16:37 -0500 (Tue, 22 Jun 2010) | 1 line remove INT_MAX assertions; they can fail with large Py_ssize_t #9058 ........
* Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s#Victor Stinner2010-06-071-2/+2
|
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-22/+22
| | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r81029 | antoine.pitrou | 2010-05-09 16:46:46 +0200 (dim., 09 mai 2010) | 3 lines Untabify C files. Will watch buildbots. ........
* Don't decode/recode the unicode filename in SyntaxError_str()Victor Stinner2010-04-281-20/+34
| | | | | * Rewrite my_basename() to use unicode * Use '%U' format
* plug reference leakBenjamin Peterson2010-02-251-1/+1
|
* Merged revisions 78418 via svnmerge fromEric Smith2010-02-241-34/+79
| | | | | | | | | | 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 ↵Benjamin Peterson2009-06-281-2/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 73376,73393,73398,73400,73404-73405,73409,73419-73421,73432,73457,73460,73485-73486,73488-73489,73501-73502,73513-73514 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r73376 | benjamin.peterson | 2009-06-11 17:29:23 -0500 (Thu, 11 Jun 2009) | 1 line remove check for case handled in sub-function ........ r73393 | alexandre.vassalotti | 2009-06-12 13:56:57 -0500 (Fri, 12 Jun 2009) | 2 lines Clear reference to the static PyExc_RecursionErrorInst in _PyExc_Fini. ........ r73398 | alexandre.vassalotti | 2009-06-12 15:57:12 -0500 (Fri, 12 Jun 2009) | 3 lines Add const qualifier to PyErr_SetFromErrnoWithFilename and to PyErr_SetFromErrnoWithUnicodeFilename. ........ r73400 | alexandre.vassalotti | 2009-06-12 16:43:47 -0500 (Fri, 12 Jun 2009) | 2 lines Delete outdated make file for building the parser with MSVC 6. ........ r73404 | benjamin.peterson | 2009-06-12 20:40:00 -0500 (Fri, 12 Jun 2009) | 1 line keep the slice.step field as NULL if no step expression is given ........ r73405 | benjamin.peterson | 2009-06-12 22:46:30 -0500 (Fri, 12 Jun 2009) | 1 line prevent import statements from assigning to None ........ r73409 | benjamin.peterson | 2009-06-13 08:06:21 -0500 (Sat, 13 Jun 2009) | 1 line allow importing from a module named None if it has an 'as' clause ........ r73419 | benjamin.peterson | 2009-06-13 11:19:19 -0500 (Sat, 13 Jun 2009) | 1 line set Print.values to NULL if there are no values ........ r73420 | benjamin.peterson | 2009-06-13 12:08:53 -0500 (Sat, 13 Jun 2009) | 1 line give a better error message when deleting () ........ r73421 | benjamin.peterson | 2009-06-13 15:23:33 -0500 (Sat, 13 Jun 2009) | 1 line when no module is given in a 'from' relative import, make ImportFrom.module NULL ........ r73432 | amaury.forgeotdarc | 2009-06-14 16:20:40 -0500 (Sun, 14 Jun 2009) | 3 lines #6227: Because of a wrong indentation, the test was not testing what it should. Ensure that the snippet in doctest_aliases actually contains aliases. ........ r73457 | benjamin.peterson | 2009-06-16 18:13:09 -0500 (Tue, 16 Jun 2009) | 1 line add underscores ........ r73460 | benjamin.peterson | 2009-06-16 22:23:04 -0500 (Tue, 16 Jun 2009) | 1 line remove unused 'encoding' member from the compiler struct ........ r73485 | benjamin.peterson | 2009-06-19 17:07:47 -0500 (Fri, 19 Jun 2009) | 1 line remove duplicate test ........ r73486 | benjamin.peterson | 2009-06-19 17:09:17 -0500 (Fri, 19 Jun 2009) | 1 line add missing assertion #6313 ........ r73488 | benjamin.peterson | 2009-06-19 17:16:28 -0500 (Fri, 19 Jun 2009) | 1 line show that this one isn't used ........ r73489 | benjamin.peterson | 2009-06-19 17:21:12 -0500 (Fri, 19 Jun 2009) | 1 line use closures ........ r73501 | benjamin.peterson | 2009-06-21 18:01:07 -0500 (Sun, 21 Jun 2009) | 1 line don't need to add the name 'lambda' as assigned ........ r73502 | benjamin.peterson | 2009-06-21 18:03:36 -0500 (Sun, 21 Jun 2009) | 1 line remove tmpname support since it's no longer used ........ r73513 | benjamin.peterson | 2009-06-22 20:18:57 -0500 (Mon, 22 Jun 2009) | 1 line fix grammar ........ r73514 | benjamin.peterson | 2009-06-22 22:01:56 -0500 (Mon, 22 Jun 2009) | 1 line remove some unused symtable constants ........
* Merged revisions 73447-73448 via svnmerge fromGeorg Brandl2009-06-161-1/+0
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r73447 | georg.brandl | 2009-06-16 19:41:33 +0200 (Di, 16 Jun 2009) | 1 line Add tabularcolumns directive for tables with bullet lists in them. ........ r73448 | georg.brandl | 2009-06-16 19:43:44 +0200 (Di, 16 Jun 2009) | 1 line Remove unused macro. ........
* Fix segfaults when running test_exceptions with coverage tracing, caused by ↵Georg Brandl2009-03-311-9/+57
| | | | wrongly defining Exception.__context__ as a T_OBJECT structmember which does not set the member to NULL on None assignment, and generally does not do type checks. This could be used to crash the interpreter by setting any object to __context__. The same applies to __cause__. Also document the PyException_* functions.
* Merged revisions ↵Benjamin Peterson2009-02-131-34/+0
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 69364-69365,69409-69410,69413,69417,69435,69442,69447,69495,69519-69521 via svnmerge from svn+ssh://pythondev@svn.python.org/python/trunk ........ r69364 | kristjan.jonsson | 2009-02-06 04:17:34 -0600 (Fri, 06 Feb 2009) | 1 line Fix a number of Win32ErrorTests error cases. chmod wasn't being tested. 'access' never raises an error. ........ r69365 | armin.rigo | 2009-02-06 05:46:26 -0600 (Fri, 06 Feb 2009) | 2 lines Ivan on IRC in #twisted reported this crasher. ........ r69409 | georg.brandl | 2009-02-07 06:21:17 -0600 (Sat, 07 Feb 2009) | 1 line #5174: fix wrong file closing in example. ........ r69410 | neil.schemenauer | 2009-02-07 08:53:31 -0600 (Sat, 07 Feb 2009) | 4 lines Fix broken test in test_hotshot. Treating the current directory as an empty file is sloppy and non-portable. Use NamedTemporaryFile to make an empty file. ........ r69413 | neil.schemenauer | 2009-02-07 12:35:16 -0600 (Sat, 07 Feb 2009) | 2 lines Add test for issue #999042, explict global statement works. ........ r69417 | benjamin.peterson | 2009-02-07 17:01:19 -0600 (Sat, 07 Feb 2009) | 1 line document individual 2to3 fixers ........ r69435 | benjamin.peterson | 2009-02-08 08:38:13 -0600 (Sun, 08 Feb 2009) | 1 line document numliterals fixer ........ r69442 | benjamin.peterson | 2009-02-08 09:14:57 -0600 (Sun, 08 Feb 2009) | 1 line a few edits and typos ........ r69447 | vinay.sajip | 2009-02-08 13:06:08 -0600 (Sun, 08 Feb 2009) | 2 lines Issue #5170: Fixed Unicode output bug in logging and added test case. This is a regression which did not occur in 2.5. ........ r69495 | kristjan.jonsson | 2009-02-10 07:32:24 -0600 (Tue, 10 Feb 2009) | 1 line Issue 4804. Add a function to test the validity of file descriptors on Windows, and stop using global runtime settings to silence the warnings / assertions. ........ r69519 | gregory.p.smith | 2009-02-11 17:45:25 -0600 (Wed, 11 Feb 2009) | 3 lines Issue #1008086: Fixes socket.inet_aton() to always return 4 bytes even on LP64 platforms (most 64-bit Linux, bsd, unix systems). ........ r69520 | benjamin.peterson | 2009-02-11 21:50:00 -0600 (Wed, 11 Feb 2009) | 1 line os.fsync() should be used to ensure that data is written to disk ........ r69521 | benjamin.peterson | 2009-02-11 22:17:04 -0600 (Wed, 11 Feb 2009) | 1 line no need for this __bases__ trick anymore ........
* Issue #1717: rename tp_compare to tp_reserved. I'll change theMark Dickinson2009-02-021-1/+1
| | | | | type of tp_compare in a separate commit, for ease of reversion should things go wrong.