summaryrefslogtreecommitdiffstats
Commit message (Collapse)AuthorAgeFilesLines
* 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
|
* Must terminate the Pickler_members[] and Pickler_getsets with NULL.Jeremy Hylton2001-10-161-1/+3
|
* Refactored the update_slot() code a bit to be hopefully slightly moreGuido van Rossum2001-10-161-57/+61
| | | | | | | | | | | | | efficient: - recurse down subclasses only once rather than for each affected slot; - short-circuit recursing down subclasses when a subclass has its own definition of the name that caused the update_slot() calls in the first place; - inline collect_ptrs().
* Put descr name in "bad memberdescr type" error message.Jeremy Hylton2001-10-161-1/+2
|
* Added information about setprofile() and settrace() hooks being thread-Fred Drake2001-10-161-2/+9
| | | | | specific, and updated some of the comments about the profile hook. This closes SF bug #471725.
* Fix thinko in a comment about seeking with a file object.Fred Drake2001-10-161-1/+1
| | | | Reported by Francesco Trentini.
* Reword the text on the demise of __dynamic__ somewhat, correcting aGuido van Rossum2001-10-161-4/+5
| | | | typo.
* Remove obsolete __dynamic__ distinction.Tim Peters2001-10-151-126/+8
|
* Remove obsolete __dynamic__ distinction.Tim Peters2001-10-152-76/+1
|
* Remove obsolete __static__/__dynamic__ distinction.Tim Peters2001-10-151-11/+3
|
* pstats-compatible analysis module.Fred Drake2001-10-151-0/+93
| | | | | hotshot.stats.load(logfilename) returns a pstats.Stats instance, which is about as compatible as it gets.
* runcall(): Expose the return value of the profiled function; this allowsFred Drake2001-10-151-1/+1
| | | | | | changing an application to collect profile data on one part of the app while still making use of the profiled component, without relying on side effects.
* Removed useless code to count the number of calls into the profiler.Fred Drake2001-10-151-51/+177
| | | | | | | | | | | Added support for saving the names of the functions observed into the profile log. Added support for using the profiler to measure coverage without collecting timing information (which is the slow part). Coverage logs can also be substantially smaller than profiling logs where per-line information is being collected. Updated comments on the log format; corrected record type values in some of the record descriptions.
* Avoid deep recursion when reading the header of the log file.Fred Drake2001-10-151-28/+39
| | | | | Add support for extracting function names from the log file, keeping the extract-names-from-sources support as a fallback.
* Get rid of __defined__ and tp_defined -- there's no need toGuido van Rossum2001-10-154-67/+33
| | | | | distinguish __dict__ and __defined__ any more. In the C structure, tp_cache takes its place -- but this hasn't been implemented yet.
* Covert pickle tests to use unittest.Jeremy Hylton2001-10-155-193/+294
| | | | | Extend tests to cover a few more cases. For cPickle, test several of the undocumented features.
* Better fix for core dumps on recursive objects in fast mode.Jeremy Hylton2001-10-151-32/+64
| | | | | | | | | | | | | | | | | | | Raise ValueError when an object contains an arbitrarily nested reference to itself. (The previous fix just produced invalid pickles.) Solution is very much like Py_ReprEnter() and Py_ReprLeave(): fast_save_enter() and fast_save_leave() that tracks the fast_container limit and keeps a fast_memo of objects currently being pickled. The cost of the solution is moderately expensive for deeply nested structures, but it still seems to be faster than normal pickling, based on tests with deeply nested lists. Once FAST_LIMIT is exceeded, the new code is about twice as slow as fast-mode code that doesn't check for recursion. It's still twice as fast as the normal pickling code. In the absence of deeply nested structures, I couldn't measure a difference.
* Use cStringIO when available.Jeremy Hylton2001-10-151-36/+4
| | | | Remove test code. It's available in Lib/test/picklertester.py.
* Remove a couple of tp_xxx fields that you are not expected toGuido van Rossum2001-10-151-5/+0
| | | | initialize (or use or even know about :-).
* Fix a bunch of warnings reported by Skip.Guido van Rossum2001-10-151-8/+8
| | | | | | | To whoever who changed a bunch of (PyCFunction) casts to (PyNoArgsFunction) in PyMethodDef initializers: don't do that. The cast is to shut the compiler up. The compiler wants the function pointer initializer to be a PyCFunction.
* Completely get rid of __dynamic__ and the correspondingGuido van Rossum2001-10-153-157/+42
| | | | | Py_TPFLAGS_DYNAMICTYPE bit. There is no longer a performance benefit, and I don't really see the use case any more.
* make getarray static - it's only called from ceval.c and is not anSkip Montanaro2001-10-151-1/+1
| | | | extern-able name.
* Another contributor.Guido van Rossum2001-10-151-0/+1
|
* Add (void *) casts to solve some problems on HP-UX 11.0, as discussedGuido van Rossum2001-10-151-3/+3
| | | | on SF bug #467145.