summaryrefslogtreecommitdiffstats
path: root/Objects/exceptions.c
Commit message (Collapse)AuthorAgeFilesLines
* Renamed PyString to PyBytesChristian Heimes2008-05-261-48/+48
|
* A little reformating of Py3k warningsBenjamin Peterson2008-04-271-6/+4
|
* Use PyErr_WarnPy3k throughoutBenjamin Peterson2008-04-271-12/+6
|
* Merged revisions ↵Christian Heimes2008-03-261-0/+8
| | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | | 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. ........
* Make Py3k warnings consistent w.r.t. punctuation; also respect theGeorg Brandl2008-03-251-8/+8
| | | | EOL 80 limit and supply more alternatives in warning messages.
* Finish backporting new buffer API to Python 2.6. Left to do: memoryview ↵Travis E. Oliphant2008-03-181-0/+5
| | | | object and structmodule. But, these need to be finished in Python 3.0 first. No objects support the new buffer API in Python 2.6 as of yet, and except for the memoryview object, I don't think they will.
* - Issue 2379: Raise a Py3K warning for __getitem__ or __getslice__ onGuido van Rossum2008-03-181-0/+12
| | | | exception instances.
* #1629: Renamed Py_Size, Py_Type and Py_Refcnt to Py_SIZE, Py_TYPE and ↵Christian Heimes2007-12-191-12/+12
| | | | Py_REFCNT. Macros for b/w compatibility are available.
* Patch #1537 from Chad AustinChristian Heimes2007-12-031-2/+2
| | | | | Change GeneratorExit's base class from Exception to BaseException (This time I'm applying the patch to the correct sandbox.)
* Fix a crasher where Python code managed to infinitely recurse in C code withoutBrett Cannon2007-09-071-0/+29
| | | | | | | 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.
* Revert accidental checkins from last commit.Georg Brandl2007-08-211-32/+6
|
* Demand version 2.5.1 since 2.5 has a bug with codecs.open context managers.Georg Brandl2007-08-211-6/+32
|
* PEP 3123: Provide forward compatibility with Python 3.0, while keepingMartin v. Löwis2007-07-211-12/+12
| | | | | backwards compatibility. Add Py_Refcnt, Py_Type, Py_Size, and PyVarObject_HEAD_INIT.
* Add T_PYSSIZET in structmember.h: This can be used forWalter Dörwald2007-06-131-166/+102
| | | | | | | | | 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.
* Complete deprecation of BaseException.message. Some subclasses were directlyBrett Cannon2007-05-171-10/+0
| | | | accessing the message attribute instead of using the descriptor.
* Deprecate BaseException.message as per PEP 352.Brett Cannon2007-05-051-8/+34
|
* Add some missing NULL checks which trigger crashes on low-memory conditions.Georg Brandl2007-04-111-0/+2
| | | | Found by Victor Stinner. Will backport when 2.5 branch is unfrozen.
* Variation of patch # 1624059 to speed up checking if an object is a subclassNeal Norwitz2007-02-251-1/+2
| | | | | | | | | | | | | | | | | | 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.
* WindowsError.str should display the windows error code,Thomas Heller2006-10-271-7/+7
| | | | | | | not the posix error code; with test. Fixes #1576174. Will backport to release25-maint.
* Bug #1566800: make sure that EnvironmentError can be called with anyGeorg Brandl2006-09-301-1/+1
| | | | number of arguments, as was the case in Python 2.4.
* Allow exceptions to be directly sliced againBrett Cannon2006-09-201-1/+8
| | | | | | | (e.g., ``BaseException(1,2,3)[0:2]``). Discovered in Python 2.5.0 by Thomas Heller and reported to python-dev. This should be backported to 2.5 .
* Remove the __unicode__ method from exceptions. Allows unicode() to be calledBrett Cannon2006-09-091-17/+0
| | | | | | | on exception classes. Would require introducing a tp_unicode slot to make it work otherwise. Fixes bug #1551432 and will be backported.
* Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.Georg Brandl2006-09-061-2/+8
| | | | | Also make sure that every exception class has __module__ set to 'exceptions'.
* Slightly revised version of patch #1538956:Marc-André Lemburg2006-08-141-0/+10
| | | | | | | | | | 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.
* Fix build problems with the platform SDK on windows. It is not sufficient ↵Kristján Valur Jónsson2006-07-031-3/+3
| | | | to test for the C compiler version when determining if we have the secure CRT from microsoft. Must test with an undocumented macro, __STDC_SECURE_LIB__ too.
* Fix the CRT argument error handling for VisualStudio .NET 2005. Install a ↵Kristján Valur Jónsson2006-06-121-0/+35
| | | | | | CRT error handler and disable the assertion for debug builds. This causes CRT to set errno to EINVAL. This update fixes crash cases in the test suite where the default CRT error handler would cause process exit.
* SF #1499797, Fix for memory leak in WindowsError_strNeal Norwitz2006-06-041-1/+0
|
* Fix memory leak found by valgrind.Neal Norwitz2006-06-021-1/+0
|
* Correctly unpickle 2.4 exceptions via __setstate__ (patch #1498571)Georg Brandl2006-06-011-0/+24
|
* Do the check for no keyword arguments in __init__ so thatGeorg Brandl2006-05-301-3/+3
| | | | subclasses of Exception can be supplied keyword args
* Disallow keyword args for exceptions.Georg Brandl2006-05-301-0/+3
|
* Add a test case for exception pickling. args is never NULL.Georg Brandl2006-05-301-11/+8
|
* Restore exception pickle support. #1497319.Georg Brandl2006-05-301-1/+11
|
* Fix refleak in socketmodule. Replace bogus Py_BuildValue calls.Georg Brandl2006-05-291-0/+1
| | | | Fix refleak in exceptions.
* Make last patch valid C89 so Windows compilers can deal with it.Thomas Wouters2006-05-281-1/+2
|
* use the UnicodeError traversal and clearing functions in UnicodeErrorMichael W. Hudson2006-05-281-4/+4
| | | | subclasses.
* Fix refleaks in UnicodeError get and set methods.Georg Brandl2006-05-281-45/+56
|
* Quality control, meet exceptions.c, round two.Michael W. Hudson2006-05-281-222/+165
| | | | | | | | | | | | | | | | Make some functions that should have been static static. Fix a bunch of refleaks by fixing the definition of MiddlingExtendsException. Remove all the __new__ implementations apart from BaseException_new. Rewrite most code that needs it to cope with NULL fields (such code could get excercised anyway, the __new__-removal just makes it more likely). This involved editing the code for WindowsError, which I can't test. This fixes all the refleaks in at least the start of a regrtest -R :: run.
* Quality control, meet exceptions.c.Michael W. Hudson2006-05-281-128/+105
| | | | | | | | | | | | | | | | | | | | | | | | | | Fix a number of problems with the need for speed code: One is doing this sort of thing: Py_DECREF(self->field); self->field = newval; Py_INCREF(self->field); without being very sure that self->field doesn't start with a value that has a __del__, because that almost certainly can lead to segfaults. As self->args is constrained to be an exact tuple we may as well exploit this fact consistently. This leads to quite a lot of simplification (and, hey, probably better performance). Add some error checking in places lacking it. Fix some rather strange indentation in the Unicode code. Delete some trailing whitespace. More to come, I haven't fixed all the reference leaks yet...
* move semicolonsRichard Jones2006-05-271-53/+51
|
* doc string additions and tweaksRichard Jones2006-05-271-8/+21
|
* Remove spurious semicolons after macro invocations.Georg Brandl2006-05-271-42/+42
|
* Conversion of exceptions over from faked-up classes to new-style C types.Richard Jones2006-05-271-0/+2130