summaryrefslogtreecommitdiffstats
path: root/Python/errors.c
Commit message (Collapse)AuthorAgeFilesLines
* Issue #21715: Extracted shared complicated code in the _io module to newSerhiy Storchaka2014-10-081-0/+24
| | | | _PyErr_ChainExceptions() function.
* Issue #20517: Removed unnecessary new (short-lived) functions from PyErr.Larry Hastings2014-02-101-101/+3
|
* Issue #20517: Functions in the os module that accept two filenamesLarry Hastings2014-02-101-22/+147
| | | | | | 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 #19512, #19515: remove shared identifiers, move identifiers where theyVictor Stinner2013-11-071-2/+5
| | | | | | | are used. Move also _Py_IDENTIFIER() defintions to the top in modified files to remove identifiers duplicated in the same file.
* Issue #19512: add _PyUnicode_CompareWithId() functionVictor Stinner2013-11-061-1/+1
| | | | | | | _PyUnicode_CompareWithId() is faster than PyUnicode_CompareWithASCIIString() when both strings are equal and interned. Add also _PyId_builtins identifier for "builtins" common string.
* Issue #19512: add some common identifiers to only create common strings once,Victor Stinner2013-11-061-1/+1
| | | | | | | instead of creating temporary Unicode string objects Add also more identifiers in pythonrun.c to avoid temporary Unicode string objets for the interactive interpreter.
* Don't export internal symbols ("make smelly")Antoine Pitrou2013-10-121-1/+1
|
* Factor-out the common code for setting a KeyError.Raymond Hettinger2013-09-021-0/+14
|
* Issue #18571: Implementation of the PEP 446: file descriptors and file handlesVictor Stinner2013-08-271-2/+2
| | | | | are now created non-inheritable; add functions os.get/set_inheritable(), os.get/set_handle_inheritable() and socket.socket.get/set_inheritable().
* Close #11619: The parser and the import machinery do not encode UnicodeVictor Stinner2013-08-261-15/+41
| | | | filenames anymore on Windows.
* Issue #18664, #18408: Rewrite PyErr_WriteUnraisable() to handle errorsVictor Stinner2013-08-261-40/+62
| | | | | | | | * Catch PyFile_WriteString() and PyFile_WriteObject() errors * Clear the current exception on _PyObject_GetAttrId() failure * Use PyUnicode_CompareWithASCIIString() and PyFile_WriteObject() instead of _PyUnicode_AsString() and strcmp() to avoid Unicode encoding error. stderr has a more tolerant error handler than utf-8/strict.
* Issue #18520: PyErr_NoMemory() now fails with a fatal error if it is calledVictor Stinner2013-07-221-0/+6
| | | | before PyExc_MemoryError has been initialized by _PyExc_Init()
* Issue #18408: PyEval_EvalFrameEx() and PyEval_CallObjectWithKeywords() now failVictor Stinner2013-07-171-0/+11
| | | | | | | | | | | | with an assertion error if they are called with an exception set (PyErr_Occurred()). If these functions are called with an exception set, the exception may be cleared and so the caller looses its exception. Add also assertions to PyEval_CallObjectWithKeywords() and call_function() to check if the function succeed with no exception set, or the function failed with an exception set.
* Issue #18408: Fix PyErr_SetImportError(), handle PyDict_SetItemString() failureVictor Stinner2013-07-171-2/+5
|
* Issue #18408: Fix PyErr_NormalizeException(), handle PyObject_IsSubclass() ↵Victor Stinner2013-07-161-1/+10
| | | | | | failure PyObject_IsSubclass() can fail and raise a new exception!
* Issue #18408: errors.c: in debug mode, calling PyErr_BadInternalCall() nowVictor Stinner2013-07-111-0/+1
| | | | fails with an assertion error
* Issue #15767: Revert 3a50025f1900 for ModuleNotFoundErrorBrett Cannon2013-07-041-22/+3
|
* Issue #15767: Touch up ModuleNotFoundError usage by import.Brett Cannon2013-06-131-3/+22
| | | | | | | | | | | | | Forgot to raise ModuleNotFoundError when None is found in sys.modules. This led to introducing the C function PyErr_SetImportErrorSubclass() to make setting ModuleNotFoundError easier. Also updated the reference docs to mention ModuleNotFoundError appropriately. Updated the docs for ModuleNotFoundError to mention the None in sys.modules case. Lastly, it was noticed that PyErr_SetImportError() was not setting an exception when returning None in one case. That issue is now fixed.
* Issue #16719: Get rid of WindowsError. Use OSError insteadAndrew Svetlov2012-12-191-3/+3
| | | | Patch by Serhiy Storchaka.
* Issue #7317: Display full tracebacks when an error occurs asynchronously.Andrew Svetlov2012-11-031-7/+8
| | | | Patch by Alon Horev with update by Alexey Kachayev.
* Issue #14098: New functions PyErr_GetExcInfo and PyErr_SetExcInfo.Martin v. Löwis2012-04-191-0/+33
| | | | Patch by Stefan Behnel.
* Fix it for good :-)Antoine Pitrou2012-04-181-3/+1
|
* fix refcnt/style/debuging oversightsBenjamin Peterson2012-04-181-5/+7
|
* Fix email post-commit review comments.Brian Curtin2012-04-181-8/+11
| | | | | | Add INCREFs, fix args->kwargs, and a second args==NULL check was removed, left over from a merger with another function. Instead, checking msg==NULL does what that used to do in a roundabout way.
* Fix #14600. Correct reference handling and naming of ImportError convenience ↵Brian Curtin2012-04-171-27/+20
| | | | function
* Issue #1559549: Add 'name' and 'path' attributes to ImportError.Brett Cannon2012-04-131-0/+47
| | | | | | | | 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 #13560: Locale codec functions use the classic "errors" parameter,Victor Stinner2011-12-171-1/+1
| | | | | | instead of surrogateescape So it would be possible to support more error handlers later.
* Issue #13560: os.strerror() now uses the current locale encoding instead of ↵Victor Stinner2011-12-171-8/+9
| | | | UTF-8
* Issue #13575: there is only one class type.Florent Xicluna2011-12-121-1/+1
|
* Instantiate the OS-related exception as soon as we raise it, so that "except"Victor Stinner2011-10-171-5/+9
| | | | | | | | works properly. PyErr_SetFromErrnoWithFilenameObject() was already fixed by the changeset 793c75177d28. This commit fixes PyErr_SetExcFromWindowsErrWithFilenameObject(), used on Windows.
* Port SetAttrString/HasAttrString to SetAttrId/GetAttrId.Martin v. Löwis2011-10-141-10/+16
|
* Rename _Py_identifier to _Py_IDENTIFIER.Martin v. Löwis2011-10-141-1/+1
|
* Instantiate the OS-related exception as soon as we raise it, so thatAntoine Pitrou2011-10-121-6/+10
| | | | "except" works properly.
* PEP 3151 / issue #12555: reworking the OS and IO exception hierarchy.Antoine Pitrou2011-10-121-4/+5
|
* Use identifier API for PyObject_GetAttrString.Martin v. Löwis2011-10-101-1/+2
|
* Implement PEP 393.Martin v. Löwis2011-09-281-2/+2
|
* Issue #10780: PyErr_SetFromWindowsErrWithFilename() andVictor Stinner2010-12-281-2/+2
| | | | | PyErr_SetExcFromWindowsErrWithFilename() decode the filename from the filesystem encoding instead of UTF-8.
* Issue #5437: A preallocated MemoryError instance should not hold tracebackAntoine Pitrou2010-10-281-23/+1
| | | | 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-2/+4
| | | | | | | | is silent by default, except when configured --with-pydebug. Emit this warning from the GC shutdown procedure, rather than just printing to stderr.
* PyErr_SyntaxLocationEx() uses PyUnicode_DecodeFSDefault(), instead ofVictor Stinner2010-10-171-1/+1
| | | | PyUnicode_FromString(), to decode the filename.
* add PyErr_SyntaxLocationEx, to support adding a column offsetBenjamin Peterson2010-09-201-1/+17
|
* Issue #8848: U / U# formats of Py_BuildValue() are just alias to s / s#Victor Stinner2010-06-071-1/+1
|
* Make PyErr_Occurred return NULL if there is no current thread. Previously itJeffrey Yasskin2010-05-131-3/+8
| | | | | | | would Py_FatalError, which called PyErr_Occurred, resulting in a semi-infinite recursion. Fixes issue 3605.
* Recorded merge of revisions 81029 via svnmerge fromAntoine Pitrou2010-05-091-641/+641
| | | | | | | | | | 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. ........
* PyErr_SetFromErrnoWithFilename() decodes the filename usingVictor Stinner2010-05-081-1/+1
| | | | PyUnicode_DecodeFSDefault() instead of PyUnicode_FromString()
* Poor PLAN9, it isn't supportedAntoine Pitrou2010-02-221-9/+0
|
* Merged revisions 77088 via svnmerge fromGeorg Brandl2009-12-281-0/+35
| | | | | | | | | | 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. ........
* Merged revisions 72698-72699 via svnmerge fromHirokazu Yamamoto2009-05-171-6/+2
| | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r72698 | hirokazu.yamamoto | 2009-05-17 11:52:09 +0900 | 1 line Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more. ........ r72699 | hirokazu.yamamoto | 2009-05-17 11:58:36 +0900 | 1 line Added NEWS for r72698. ........
* Merged revisions 71024,71058 via svnmerge fromGeorg Brandl2009-04-111-1/+9
| | | | | | | | | | | | | | | | | svn+ssh://pythondev@svn.python.org/python/trunk ........ r71024 | georg.brandl | 2009-04-02 04:47:44 +0200 (Do, 02 Apr 2009) | 4 lines In PyErr_GivenExceptionMatches, temporarily bump the recursion limit, so that in the most common case PyObject_IsSubclass will not raise a recursion error we have to ignore anyway. ........ r71058 | georg.brandl | 2009-04-02 20:09:04 +0200 (Do, 02 Apr 2009) | 3 lines PyErr_NormalizeException may not set an error, so convert the PyErr_SetObject call on hitting the recursion limit into just assigning it to the arguments provided. ........
* Issue 3611: in some cases (a __del__ re-raising an exception, when called ↵Amaury Forgeot d'Arc2008-08-291-5/+9
| | | | | | | | | | | | | from inside an 'except' clause), the exception __context__ would be reset to None. This crases the interpreter if this precisely happens inside PyErr_SetObject. - now the __context__ is properly preserved - in any case, PyErr_SetObject now saves the current exc_value in a local variable, to avoid such crashes in the future. Reviewer: Antoine Pitrou.