summaryrefslogtreecommitdiffstats
path: root/Include/pyerrors.h
Commit message (Collapse)AuthorAgeFilesLines
* Untabify C files. Will watch buildbots.Antoine Pitrou2010-05-091-34/+34
|
* #7033: add new API function PyErr_NewExceptionWithDoc, for easily giving new ↵Georg Brandl2009-12-281-2/+4
| | | | exceptions a docstring.
* Add const qualifier to PyErr_SetFromErrnoWithFilename and toAlexandre Vassalotti2009-06-121-2/+3
| | | | PyErr_SetFromErrnoWithUnicodeFilename.
* Issue #3527: Removed Py_WIN_WIDE_FILENAMES which is not used any more.Hirokazu Yamamoto2009-05-171-7/+3
|
* This reverts r63675 based on the discussion in this thread:Gregory P. Smith2008-06-091-1/+1
| | | | | | | http://mail.python.org/pipermail/python-dev/2008-June/079988.html Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names in the spirit of 3.0 are available via a #define only. See the email thread.
* Renamed PyString to PyBytesChristian Heimes2008-05-261-1/+1
|
* Re-implement the 'warnings' module in C. This allows for usage of theBrett Cannon2008-04-121-10/+0
| | | | | | | | | 'warnings' code in places where it was previously not possible (e.g., the parser). It could also potentially lead to a speed-up in interpreter start-up if the C version of the code (_warnings) is imported over the use of the Python version in key places. Closes issue #1631171.
* Merged revisions ↵Christian Heimes2008-03-261-0/+1
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 61750,61752,61754,61756,61760,61763,61768,61772,61775,61805,61809,61812,61819,61917,61920,61930,61933-61934 via svnmerge from svn+ssh://pythondev@svn.python.org/python/branches/trunk-bytearray ........ r61750 | christian.heimes | 2008-03-22 20:47:44 +0100 (Sat, 22 Mar 2008) | 1 line Copied files from py3k w/o modifications ........ r61752 | christian.heimes | 2008-03-22 20:53:20 +0100 (Sat, 22 Mar 2008) | 7 lines Take One * Added initialization code, warnings, flags etc. to the appropriate places * Added new buffer interface to string type * Modified tests * Modified Makefile.pre.in to compile the new files * Added bytesobject.c to Python.h ........ r61754 | christian.heimes | 2008-03-22 21:22:19 +0100 (Sat, 22 Mar 2008) | 2 lines Disabled bytearray.extend for now since it causes an infinite recursion Fixed serveral unit tests ........ r61756 | christian.heimes | 2008-03-22 21:43:38 +0100 (Sat, 22 Mar 2008) | 5 lines Added PyBytes support to several places: str + bytearray ord(bytearray) bytearray(str, encoding) ........ r61760 | christian.heimes | 2008-03-22 21:56:32 +0100 (Sat, 22 Mar 2008) | 1 line Fixed more unit tests related to type('') is not unicode ........ r61763 | christian.heimes | 2008-03-22 22:20:28 +0100 (Sat, 22 Mar 2008) | 2 lines Fixed more unit tests Fixed bytearray.extend ........ r61768 | christian.heimes | 2008-03-22 22:40:50 +0100 (Sat, 22 Mar 2008) | 1 line Implemented old buffer interface for bytearray ........ r61772 | christian.heimes | 2008-03-22 23:24:52 +0100 (Sat, 22 Mar 2008) | 1 line Added backport of the io module ........ r61775 | christian.heimes | 2008-03-23 03:50:49 +0100 (Sun, 23 Mar 2008) | 1 line Fix str assignement to bytearray. Assignment of a str of size 1 is interpreted as a single byte ........ r61805 | christian.heimes | 2008-03-23 19:33:48 +0100 (Sun, 23 Mar 2008) | 3 lines Fixed more tests Fixed bytearray() comparsion with unicode() Fixed iterator assignment of bytearray ........ r61809 | christian.heimes | 2008-03-23 21:02:21 +0100 (Sun, 23 Mar 2008) | 2 lines str(bytesarray()) now returns the bytes and not the representation of the bytearray object Enabled and fixed more unit tests ........ r61812 | christian.heimes | 2008-03-23 21:53:08 +0100 (Sun, 23 Mar 2008) | 3 lines Clear error PyNumber_AsSsize_t() fails Use CHARMASK for ob_svall access disabled a test with memoryview again ........ r61819 | christian.heimes | 2008-03-23 23:05:57 +0100 (Sun, 23 Mar 2008) | 1 line Untested updates to the PCBuild directory ........ r61917 | christian.heimes | 2008-03-26 00:57:06 +0100 (Wed, 26 Mar 2008) | 1 line The type system of Python 2.6 has subtle differences to 3.0's. I've removed the Py_TPFLAGS_BASETYPE flags from bytearray for now. bytearray can't be subclasses until the issues with bytearray subclasses are fixed. ........ r61920 | christian.heimes | 2008-03-26 01:44:08 +0100 (Wed, 26 Mar 2008) | 2 lines Disabled last failing test I don't understand what the test is testing and how it suppose to work. Ka-Ping, please check it out. ........ r61930 | christian.heimes | 2008-03-26 12:46:18 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytes warning code ........ r61933 | christian.heimes | 2008-03-26 13:20:46 +0100 (Wed, 26 Mar 2008) | 1 line Fixed a bug in the new buffer protocol. The buffer slots weren't copied into a subclass. ........ r61934 | christian.heimes | 2008-03-26 13:25:09 +0100 (Wed, 26 Mar 2008) | 1 line Re-enabled bytearray subclassing - all tests are passing. ........
* Add necessary headers to back-port new buffer protocol to Python 2.6Travis E. Oliphant2008-03-171-0/+2
|
* Patch #1583 by Adam Olsen.Guido van Rossum2007-12-191-0/+3
| | | | | | | This adds signal.set_wakeup_fd(fd) which sets a file descriptor to which a zero byte will be written whenever a C exception handler runs. I added a simple C API as well, PySignal_SetWakeupFd(fd).
* Fix a crasher where Python code managed to infinitely recurse in C code withoutBrett Cannon2007-09-071-0/+1
| | | | | | | ever going back out to Python code in PyObject_Call(). Required introducing a static RuntimeError instance so that normalizing an exception there is no reliance on a recursive call that would put the exception system over the recursion check itself.
* Add T_PYSSIZET in structmember.h: This can be used forWalter Dörwald2007-06-131-2/+2
| | | | | | | | | Py_ssize_t members. Simplify the implementation of UnicodeError objects: start and end attributes are now stored directly as Py_ssize_t members, which simplifies various get and set functions.
* Variation of patch # 1624059 to speed up checking if an object is a subclassNeal Norwitz2007-02-251-5/+3
| | | | | | | | | | | | | | | | | | of some of the common builtin types. Use a bit in tp_flags for each common builtin type. Check the bit to determine if any instance is a subclass of these common types. The check avoids a function call and O(n) search of the base classes. The check is done in the various Py*_Check macros rather than calling PyType_IsSubtype(). All the bits are set in tp_flags when the type is declared in the Objects/*object.c files because PyType_Ready() is not called for all the types. Should PyType_Ready() be called for all types? If so and the change is made, the changes to the Objects/*object.c files can be reverted (remove setting the tp_flags). Objects/typeobject.c would also have to be modified to add conditions for Py*_CheckExact() in addition to each the PyType_IsSubtype check.
* Slightly revised version of patch #1538956:Marc-André Lemburg2006-08-141-0/+1
| | | | | | | | | | Replace UnicodeDecodeErrors raised during == and != compares of Unicode and other objects with a new UnicodeWarning. All other comparisons continue to raise exceptions. Exceptions other than UnicodeDecodeErrors are also left untouched.
* Add PyErr_WarnEx() so C code can pass the stacklevel to warnings.warn().Neal Norwitz2006-07-301-1/+5
| | | | | | This provides the proper warning for struct.pack(). PyErr_Warn() is now deprecated in favor of PyErr_WarnEx(). As mentioned by Tim Peters on python-dev.
* Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones2006-05-271-2/+66
|
* - Add new Warning class, ImportWarningThomas Wouters2006-04-271-0/+1
| | | | | | | | | | | | | | - Warn-raise ImportWarning when importing would have picked up a directory as package, if only it'd had an __init__.py. This swaps two tests (for case-ness and __init__-ness), but case-test is not really more expensive, and it's not in a speed-critical section. - Test for the new warning by importing a common non-package directory on sys.path: site-packages - In regrtest.py, silence warnings generated by the build-environment because Modules/ (which is added to sys.path for Setup-created modules) has 'zlib' and '_ctypes' directories without __init__.py's.
* PEP 352 implementation. Creates a new base class, BaseException, which has anBrett Cannon2006-03-011-0/+23
| | | | | | | | | added message attribute compared to the previous version of Exception. It is also a new-style class, making all exceptions now new-style. KeyboardInterrupt and SystemExit inherit from BaseException directly. String exceptions now raise DeprecationWarning. Applies patch 1104669, and closes bugs 1012952 and 518846.
* Merge ssize_t branch.Martin v. Löwis2006-02-151-15/+15
|
* * set_new() doesn't need to zero the structure a second time after tp_allocRaymond Hettinger2005-08-061-0/+6
| | | | | has already done the job. * Use a macro form of PyErr_Occurred() inside the set_lookkey() function.
* PEP 342 implementation. Per Guido's comments, the generator throw()Phillip J. Eby2005-08-021-0/+1
| | | | | method still needs to support string exceptions, and allow None for the third argument. Documentation updates are needed, too.
* Stop producing or using OverflowWarning. PEP 237 thought this wouldTim Peters2004-08-251-0/+1
| | | | | | | happen in 2.3, but nobody noticed it still was getting generated (the warning was disabled by default). OverflowWarning and PyExc_OverflowWarning should be removed for 2.5, and left notes all over saying so.
* Use appropriate macros not the deprecated DL_IMPORT/DL_EXPORT macrosNeal Norwitz2003-07-011-1/+1
|
* Constify filenames and scripts. Fixes #651362.Martin v. Löwis2002-12-111-4/+5
|
* Patch #614055: Support OpenVMS.Martin v. Löwis2002-12-061-0/+3
|
* Fix PEP 293 related problems with --disable-unicode buildsWalter Dörwald2002-11-211-0/+3
| | | | | reported by Michael Hudson in http://mail.python.org/pipermail/python-dev/2002-November/030299.html
* Patch 594001: PEP 277 - Unicode file name support for Windows NT.Mark Hammond2002-10-031-2/+23
|
* Use Py_GCC_ATTRIBUTE instead of __attribute__. Compilers other than GCCNeil Schemenauer2002-09-151-3/+3
| | | | might use __attribute__ in other ways (e.g. CodeWarrior).
* Removed bogus PyUnicodeTranslateError_GetEncoding, asWalter Dörwald2002-09-021-1/+0
| | | | | UnicodeTranslateError doesn't have an encoding attribute. (Spotted by Neal Norwitz)
* PEP 293 implemention (from SF patch http://www.python.org/sf/432401)Walter Dörwald2002-09-021-0/+66
|
* Added a FutureWarning for constructs that will change semantically inBarry Warsaw2002-08-141-0/+1
| | | | | the future. Changed PEP 237 hex constant warnings from DeprecationWarning to FutureWarning. Updated the documentation.
* Excise DL_EXPORT from Include.Mark Hammond2002-08-121-73/+73
| | | | Thanks to Skip Montanaro and Kalle Svensson for the patches.
* New functions for extension writers on Windows:Thomas Heller2002-07-291-0/+3
| | | | | | | | | | PyErr_SetExcFromWindowsErr(), PyErr_SetExcFromWindowsErrWithFilename(). Similar to PyErr_SetFromWindowsErrWithFilename() and PyErr_SetFromWindowsErr(), but they allow to specify the exception type to raise. Available on Windows. See SF patch #576458.
* As discussed on python-dev, add a mechanism to indicate featuresNeal Norwitz2002-05-291-0/+1
| | | | | that are in the process of deprecation (PendingDeprecationWarning). Docs could be improved.
* mysnprintf.c: Massive rewrite of PyOS_snprintf and PyOS_vsnprintf, toTim Peters2001-12-031-5/+0
| | | | | | | | | | | | | | | use wrappers on all platforms, to make this as consistent as possible x- platform (in particular, make sure there's at least one \0 byte in the output buffer). Also document more of the truth about what these do. getargs.c, seterror(): Three computations of remaining buffer size were backwards, thus telling PyOS_snprintf the buffer is larger than it actually is. This matters a lot now that PyOS_snprintf ensures there's a trailing \0 byte (because it didn't get the truth about the buffer size, it was storing \0 beyond the true end of the buffer). sysmodule.c, mywrite(): Simplify, now that PyOS_vsnprintf guarantees to produce a \0 byte.
* Removed preprocessor gimmick trying to force use of snprintf emulationTim Peters2001-11-281-8/+6
| | | | before 2.2b1.
* Add function attributes that allow GCC to check the arguments of printf-likeNeil Schemenauer2001-10-231-3/+6
| | | | functions.
* weakref.ReferenceError becomes a built-in exception now that weak ref objectsFred Drake2001-10-051-0/+1
| | | | | are moving into the core; with these changes, it will be possible for the exception to be raised without the weakref module ever being imported.
* Introduce OverflowWarning -- to be issued when short int operationsGuido van Rossum2001-08-231-0/+1
| | | | are overflowing and a long int operation is substituted.
* Enable PyOS_snprintf() et al. during alpha phase of 2.2.0 andMarc-André Lemburg2001-07-311-0/+7
| | | | add another use case to the socketmodule.
* va_list is defined in stdarg.h.Marc-André Lemburg2001-07-311-0/+1
|
* This patch turns the Python API mismatch notice into a standardMarc-André Lemburg2001-07-311-0/+16
| | | | | | | | | | | | Python warning which can be catched by means of the Python warning framework. It also adds two new APIs which hopefully make it easier for Python to switch to buffer overflow safe [v]snprintf() APIs for error reporting et al. The two new APIs are PyOS_snprintf() and PyOS_vsnprintf() and work just like the standard ones in many C libs. On platforms which have snprintf(), the native APIs are used, on all other an emulation with snprintf() tries to do its best.
* Iterators phase 1. This comprises:Guido van Rossum2001-04-201-0/+1
| | | | | | | | | | | | | | | | | | | | | | new slot tp_iter in type object, plus new flag Py_TPFLAGS_HAVE_ITER new C API PyObject_GetIter(), calls tp_iter new builtin iter(), with two forms: iter(obj), and iter(function, sentinel) new internal object types iterobject and calliterobject new exception StopIteration new opcodes for "for" loops, GET_ITER and FOR_ITER (also supported by dis.py) new magic number for .pyc files new special method for instances: __iter__() returns an iterator iteration over dictionaries: "for x in dict" iterates over the keys iteration over files: "for x in file" iterates over lines TODO: documentation test suite decide whether to use a different way to spell iter(function, sentinal) decide whether "for key in dict" is a good idea use iterators in map/filter/reduce, min/max, and elsewhere (in/not in?) speed tuning (make next() a slot tp_next???)
* Add declaration for PyErr_WarnExplicit().Guido van Rossum2001-02-281-0/+2
|
* Improve SyntaxErrors for bad future statements. Set file and locationJeremy Hylton2001-02-281-0/+4
| | | | | | | for errors raised in future.c. Move some helper functions from compile.c to errors.c and make them API functions: PyErr_SyntaxLocation() and PyErr_ProgramText().
* Add declarations for standard warning category classes (PyExc_WarningGuido van Rossum2000-12-151-0/+10
| | | | etc.) and the PyErr_Warn() function.
* REMOVED all CWI, CNRI and BeOpen copyright markings.Guido van Rossum2000-09-011-9/+0
| | | | This should match the situation in the 1.6b1 tree.
* refactor __del__ exception handler into PyErr_WriteUnraisableJeremy Hylton2000-09-011-0/+1
| | | | | add sanity check to gc: if an exception occurs during GC, call PyErr_WriteUnraisable and then call Py_FatalEror.
* Improve the exceptions raised by PyErr_BadInternalCall(); adding theFred Drake2000-08-241-0/+5
| | | | | | filename and line number of the call site to allow esier debugging. This closes SourceForge patch #101214.
* ANSI-fication of the sources -- remove Py_PROTO!Fred Drake2000-07-081-20/+22
|