summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* Expose setgroups. Fixes feature request #468116.Martin v. Löwis2001-10-186-4/+62
|
* Fix error checking done by abstract_issubclass and abstract_isinstance.Neil Schemenauer2001-10-181-44/+61
| | | | | | isinstance() now allows any object as the first argument and a class, a type or something with a __bases__ tuple attribute for the second argument. This closes SF patch #464992.
* Add trivial test cases for RAND_add() and RAND_status().Jeremy Hylton2001-10-181-1/+15
| | | | (The rest of the test cases are trivial, so I don't feel too bad.)
* Expose three OpenSSL API calls for dealing with the PRNG.Jeremy Hylton2001-10-181-0/+67
| | | | | | | | | | | | | | | | | Quoth the OpenSSL RAND_add man page: OpenSSL makes sure that the PRNG state is unique for each thread. On systems that provide /dev/urandom, the randomness device is used to seed the PRNG transparently. However, on all other systems, the application is responsible for seeding the PRNG by calling RAND_add(), RAND_egd(3) or RAND_load_file(3). I decided to expose RAND_add() because it's general and RAND_egd() because it's a useful special case. RAND_load_file() didn't seem to offer much over RAND_add(), so I skipped it. Also supplied RAND_status() which returns true if the PRNG is seeded and false if not.
* test for int and long int overflow (allows operation on 64-bit platforms)Skip Montanaro2001-10-171-2/+11
| | | | closes patch 470254
* Two merges from the mimelib project:Barry Warsaw2001-10-171-0/+34
| | | | | | | | | test_no_semis_header_splitter(): This actually should still split. test_no_split_long_header(): An example of an unsplittable line. test_no_semis_header_splitter(): Test for SF bug # 471918, Generator splitting long headers.
* Two merges from the mimelib project:Barry Warsaw2001-10-171-4/+35
| | | | | | | | _split_header(): Split on folding whitespace if the attempt to split on semi-colons failed. _split_header(): Patch by Matthew Cowles for fixing SF bug # 471918, Generator splitting long headers.
* Protect references to tp_descr_get and tp_dict with the appropriate test:Guido van Rossum2001-10-171-9/+14
| | | | PyType_HasFeature(t, Py_TPFLAGS_HAVE_CLASS).
* Oops. Catching OverflowError from int() doesn't help, since it raisesGuido van Rossum2001-10-171-2/+2
| | | | ValueError on too-large inputs.
* Remove a bunch of stuff that's no longer needed now that update_slot()Guido van Rossum2001-10-171-42/+20
| | | | | | and fixup_slot_dispatchers() always select the proper slot dispatcher. This affects slot_sq_item(), slot_tp_getattro(), and slot_tp_getattr_hook().
* The Python symtable module depends on .h files that setup.py doesn't track.Jeremy Hylton2001-10-172-1/+3
|
* Make sure the output lists are sorted, even if run with -r.Jeremy Hylton2001-10-171-0/+6
|
* Test utility to look for bad stacksize calculations.Jeremy Hylton2001-10-171-0/+43
|
* Vastly improved stacksize calculation.Jeremy Hylton2001-10-171-18/+51
| | | | | | | | | | | | | | | | | | | | | There are now no known cases where the compiler package computes a stack depth lower than the one computed by the builtin compiler. (To achieve this state, we had to fix bugs in both compilers :-). The chief change is to do the depth calculations with respect to basic blocks. The stack effect of block is calculated. Then the flow graph is traversed using breadth-first search to find the max weight path through the graph. Had to fix the StackDepthTracker to calculate the right info for several opcodes: LOAD_ATTR, CALL_FUNCTION (and friends), MAKE_CLOSURE, and DUP_TOPX. XXX Still need to handle free variables in MAKE_CLOSURE. XXX There are still a lot of places where the computed stack depth is larger than for the builtin compiler. These won't cause the interpreter to overflow the frame, but they waste space.
* Handle testlist_safe as if it were testlist.Jeremy Hylton2001-10-171-0/+4
|
* Remove unused convenience routine.Jeremy Hylton2001-10-171-19/+0
|
* For debug build, check that the stack pointer never exceeds the stack size.Jeremy Hylton2001-10-171-1/+3
|
* Fix computation of stack depth for classdef and closures.Jeremy Hylton2001-10-171-44/+44
| | | | | | | | | | | | | | | | | | | | | | Also minor tweaks to internal routines. Use PyCF_MASK instead of explicit list of flags. For the MAKE_CLOSURE opcode, the number of items popped off the stack depends on both the oparg and the number of free variables for the code object. Fix the code so it accounts for the free variables. In com_classdef(), record an extra pop to account for the STORE call after the BUILD_CLASS. Get rid of some commented out debugging code in com_push() and com_pop(). Factor string resize logic into helper routine com_check_size(). In com_addbyte(), remove redudant if statement after assert. (They test the same condition.) In several routines, use string macros instead of string functions.
* track addition of testlist_safe to GrammarJeremy Hylton2001-10-171-7/+8
|
* slot_sq_item(): ensure that self is an instance of the wrapper'sGuido van Rossum2001-10-171-3/+5
| | | | | | d_type before calling the wrapped function. fixup_slot_dispatchers(): fix indentation.
* SF patch #467430.Guido van Rossum2001-10-172-3/+5
| | | | | | - replace some log_error() calls with log_message() - flush self.rfile before forking too (hope this works on Windows)
* SF patch #471894: Makefile installs pydoc incorrectlyGuido van Rossum2001-10-171-0/+1
| | | | | Add --install-scripts=$(BINDIR) argument to "setup.py install" invocation.
* Folder.getlast(): avoid PyChecker warning.Guido van Rossum2001-10-171-1/+1
|
* Simplify and regularize docstrings. Also reformat so that each docstringTim Peters2001-10-171-52/+47
| | | | line fits in reasonable screen width.
* Trimmed trailing whitespace.Tim Peters2001-10-171-62/+62
|
* Removed more comments that didn't make much sense.Tim Peters2001-10-171-17/+1
| | | | Made the presence/absence of a semicolon after macros consistent.
* Removed obsolete comments about confused string refcount tricks (JeremyTim Peters2001-10-171-9/+4
| | | | | | | removed the tricks). Changed the ENTER/LEAVE_ZLIB macros so as not to create a new block (a new block is neither necessary nor helpful).
* Remove unused import; reported by Neal Norwitz.Fred Drake2001-10-171-1/+1
|
* Minor code cleanups based on comments from Neal Norwitz.Fred Drake2001-10-171-3/+2
|
* YAPC.Guido van Rossum2001-10-171-0/+1
|
* Undo needless INCREF chicanery introduced by SF patch #450702.Jeremy Hylton2001-10-161-47/+15
| | | | | | | | | | | | | | Apparently this patch (rev 2.41) replaced all the good old "s#" formats in PyArg_ParseTuple() with "S". Then it did PyString_FromStringAndSize() to get back the values setup by the "s#" format. It also incref'd and decref'd the string obtained by "S" even though the argument tuple had a reference to it. Replace PyString_AsString() calls with PyString_AS_STRING(). A good rule of thumb -- if you never check the return value of PyString_AsString() to see if it's NULL, you ought to be using the macro <wink>.
* Simplify and fix error handling for most cases.Jeremy Hylton2001-10-161-167/+113
| | | | | | | | | | | | | | | | | | Many functions used a local variable called return_error, which was initialized to zero. If an error occurred, it was set to true. Most of the code paths checked were only executed if return_error was false. goto is clearer. The code also seemed to be written under the curious assumption that calling Py_DECREF() on a local variable would assign the variable to NULL. As a result, more of the error-exit code paths returned an object that had a reference count of zero instead of just returning NULL. Fixed the code to explicitly assign NULL after the DECREF. A bit more reformatting, but not much. XXX Need a much better test suite for zlib, since it the current tests don't exercise any of this broken code.
* SF bug [#471111] inspect.getframeinfo() needs docs.Tim Peters2001-10-161-0/+6
| | | | TeX-ified its docstring.
* More reformatting.Jeremy Hylton2001-10-161-51/+50
|
* Add zlib_error() helper.Jeremy Hylton2001-10-161-92/+25
| | | | | It sets a ZlibError exception, using the msg from the z_stream pointer if one is available.
* Fix a bug in the previous checkin. The wrong bootstrap function wasGuido van Rossum2001-10-161-1/+1
| | | | passed to _beginthread().
* Add fix for getattr(obj, name, default). Rearrange a few things.Guido van Rossum2001-10-161-7/+14
|
* SF patch #471852 (anonymous) notes that getattr(obj, name, default)Guido van Rossum2001-10-161-1/+3
| | | | masks any exception, not just AttributeError. Fix this.
* Remove many calls to set MemoryError exceptions.Jeremy Hylton2001-10-161-28/+4
| | | | | When PyString_FromStringAndSize() and _PyString_Resize() fail, they set an exception. There's no need to set a new exception.
* Reformat!Jeremy Hylton2001-10-161-586/+576
| | | | | | Consistently indent 4 spaces. Use whitespace around operators. Put braces in the right places.
* Partial patch from SF #452266, by Jason Petrone.Guido van Rossum2001-10-1616-42/+97
| | | | | | This changes Pythread_start_thread() to return the thread ID, or -1 for an error. (It's technically an incompatible API change, but I doubt anyone calls it.)
* Add note about new zlib feature.Jeremy Hylton2001-10-161-1/+6
|
* [ #403753 ] zlib decompress; uncontrollable memory usageJeremy Hylton2001-10-164-12/+113
| | | | | | | | | | | | | Mostly by Toby Dickenson and Titus Brown. Add an optional argument to a decompression object's decompress() method. The argument specifies the maximum length of the return value. If the uncompressed data exceeds this length, the excess data is stored as the unconsumed_tail attribute. (Not to be confused with unused_data, which is a separate issue.) Difference from SF patch: Default value for unconsumed_tail is "" rather than None. It's simpler if the attribute is always a string.
* Document required return values -1, 0, 1 for tp_compare handler, asGuido van Rossum2001-10-161-2/+11
| | | | suggested in SF patch #424475. Also document exception return.
* SF bug [#468061] __str__ ignored in str subclass.Tim Peters2001-10-163-8/+52
| | | | | | | | | | | | | | | | | object.c, PyObject_Str: Don't try to optimize anything except exact string objects here; in particular, let str subclasses go thru tp_str, same as non-str objects. This allows overrides of tp_str to take effect. stringobject.c: + string_print (str's tp_print): If the argument isn't an exact string object, get one from PyObject_Str. + string_str (str's tp_str): Make a genuine-string copy of the object if it's of a proper str subclass type. str() applied to a str subclass that doesn't override __str__ ends up here. test_descr.py: New str_of_str_subclass() test.
* Add Shane.Guido van Rossum2001-10-161-0/+1
|
* SF patch #471839: Bug when extensions import extensions (Shane Hathaway)Guido van Rossum2001-10-161-2/+3
| | | | | | | | | | | | | | | | | When an extension imports another extension in its initXXX() function, the variable _Py_PackageContext is prematurely reset to NULL. If the outer extension then calls Py_InitModule(), the extension is installed in sys.modules without its package name. The manifestation of this bug is a "SystemError: _PyImport_FixupExtension: module <package>.<extension> not loaded". To fix this, importdl.c just needs to retain the old value of _Py_PackageContext and restore it after the initXXX() method is called. The attached patch does this. This patch applies to Python 2.1.1 and the current CVS.
* Fix SF bug #459767: ftplib fails with files > 2GBGuido van Rossum2001-10-161-5/+13
| | | | | size(), parse150(): try int() first, catch OverflowError, fall back to long().
* Update the description of PyTrace_EXCEPT.Fred Drake2001-10-161-5/+8
|
* Fix a few usage and style-guide conformance issues.Fred Drake2001-10-161-10/+10
|