]> granicus.if.org Git - python/log
python
23 years agoSimplify and regularize docstrings. Also reformat so that each docstring
Tim Peters [Wed, 17 Oct 2001 04:16:15 +0000 (04:16 +0000)]
Simplify and regularize docstrings.  Also reformat so that each docstring
line fits in reasonable screen width.

23 years agoTrimmed trailing whitespace.
Tim Peters [Wed, 17 Oct 2001 03:57:20 +0000 (03:57 +0000)]
Trimmed trailing whitespace.

23 years agoRemoved more comments that didn't make much sense.
Tim Peters [Wed, 17 Oct 2001 03:56:45 +0000 (03:56 +0000)]
Removed more comments that didn't make much sense.
Made the presence/absence of a semicolon after macros consistent.

23 years agoRemoved obsolete comments about confused string refcount tricks (Jeremy
Tim Peters [Wed, 17 Oct 2001 03:43:54 +0000 (03:43 +0000)]
Removed obsolete comments about confused string refcount tricks (Jeremy
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).

23 years agoRemove unused import; reported by Neal Norwitz.
Fred Drake [Wed, 17 Oct 2001 01:51:04 +0000 (01:51 +0000)]
Remove unused import; reported by Neal Norwitz.

23 years agoMinor code cleanups based on comments from Neal Norwitz.
Fred Drake [Wed, 17 Oct 2001 01:49:50 +0000 (01:49 +0000)]
Minor code cleanups based on comments from Neal Norwitz.

23 years agoYAPC.
Guido van Rossum [Wed, 17 Oct 2001 00:17:52 +0000 (00:17 +0000)]
YAPC.

23 years agoUndo needless INCREF chicanery introduced by SF patch #450702.
Jeremy Hylton [Tue, 16 Oct 2001 23:26:08 +0000 (23:26 +0000)]
Undo needless INCREF chicanery introduced by SF patch #450702.

    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>.

23 years agoSimplify and fix error handling for most cases.
Jeremy Hylton [Tue, 16 Oct 2001 23:02:32 +0000 (23:02 +0000)]
Simplify and fix error handling for most cases.

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.

23 years agoSF bug [#471111] inspect.getframeinfo() needs docs.
Tim Peters [Tue, 16 Oct 2001 23:01:06 +0000 (23:01 +0000)]
SF bug [#471111] inspect.getframeinfo() needs docs.
TeX-ified its docstring.

23 years agoMore reformatting.
Jeremy Hylton [Tue, 16 Oct 2001 21:59:35 +0000 (21:59 +0000)]
More reformatting.

23 years agoAdd zlib_error() helper.
Jeremy Hylton [Tue, 16 Oct 2001 21:56:09 +0000 (21:56 +0000)]
Add zlib_error() helper.

It sets a ZlibError exception, using the msg from the z_stream pointer
if one is available.

23 years agoFix a bug in the previous checkin. The wrong bootstrap function was
Guido van Rossum [Tue, 16 Oct 2001 21:50:04 +0000 (21:50 +0000)]
Fix a bug in the previous checkin.  The wrong bootstrap function was
passed to _beginthread().

23 years agoAdd fix for getattr(obj, name, default). Rearrange a few things.
Guido van Rossum [Tue, 16 Oct 2001 21:34:49 +0000 (21:34 +0000)]
Add fix for getattr(obj, name, default).  Rearrange a few things.

23 years agoSF patch #471852 (anonymous) notes that getattr(obj, name, default)
Guido van Rossum [Tue, 16 Oct 2001 21:31:32 +0000 (21:31 +0000)]
SF patch #471852 (anonymous) notes that getattr(obj, name, default)
masks any exception, not just AttributeError.  Fix this.

23 years agoRemove many calls to set MemoryError exceptions.
Jeremy Hylton [Tue, 16 Oct 2001 21:23:58 +0000 (21:23 +0000)]
Remove many calls to set MemoryError exceptions.

When PyString_FromStringAndSize() and _PyString_Resize() fail, they
set an exception.  There's no need to set a new exception.

23 years agoReformat!
Jeremy Hylton [Tue, 16 Oct 2001 21:19:45 +0000 (21:19 +0000)]
Reformat!

Consistently indent 4 spaces.
Use whitespace around operators.
Put braces in the right places.

23 years agoPartial patch from SF #452266, by Jason Petrone.
Guido van Rossum [Tue, 16 Oct 2001 21:13:49 +0000 (21:13 +0000)]
Partial patch from SF #452266, by Jason Petrone.

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.)

23 years agoAdd note about new zlib feature.
Jeremy Hylton [Tue, 16 Oct 2001 20:42:52 +0000 (20:42 +0000)]
Add note about new zlib feature.

23 years ago[ #403753 ] zlib decompress; uncontrollable memory usage
Jeremy Hylton [Tue, 16 Oct 2001 20:39:49 +0000 (20:39 +0000)]
[ #403753 ] zlib decompress; uncontrollable memory usage

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.

23 years agoDocument required return values -1, 0, 1 for tp_compare handler, as
Guido van Rossum [Tue, 16 Oct 2001 20:32:05 +0000 (20:32 +0000)]
Document required return values -1, 0, 1 for tp_compare handler, as
suggested in SF patch #424475.  Also document exception return.

23 years agoSF bug [#468061] __str__ ignored in str subclass.
Tim Peters [Tue, 16 Oct 2001 20:18:24 +0000 (20:18 +0000)]
SF bug [#468061] __str__ ignored in str subclass.

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.

23 years agoAdd Shane.
Guido van Rossum [Tue, 16 Oct 2001 20:13:53 +0000 (20:13 +0000)]
Add Shane.

23 years agoSF patch #471839: Bug when extensions import extensions (Shane Hathaway)
Guido van Rossum [Tue, 16 Oct 2001 20:07:34 +0000 (20:07 +0000)]
SF patch #471839: Bug when extensions import extensions (Shane Hathaway)

    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.

23 years agoFix SF bug #459767: ftplib fails with files > 2GB
Guido van Rossum [Tue, 16 Oct 2001 19:45:52 +0000 (19:45 +0000)]
Fix SF bug #459767: ftplib fails with files > 2GB

size(), parse150(): try int() first, catch OverflowError, fall back to
long().

23 years agoUpdate the description of PyTrace_EXCEPT.
Fred Drake [Tue, 16 Oct 2001 19:23:55 +0000 (19:23 +0000)]
Update the description of PyTrace_EXCEPT.

23 years agoFix a few usage and style-guide conformance issues.
Fred Drake [Tue, 16 Oct 2001 19:22:51 +0000 (19:22 +0000)]
Fix a few usage and style-guide conformance issues.

23 years agoMust terminate the Pickler_members[] and Pickler_getsets with NULL.
Jeremy Hylton [Tue, 16 Oct 2001 17:10:49 +0000 (17:10 +0000)]
Must terminate the Pickler_members[] and Pickler_getsets with NULL.

23 years agoRefactored the update_slot() code a bit to be hopefully slightly more
Guido van Rossum [Tue, 16 Oct 2001 17:00:48 +0000 (17:00 +0000)]
Refactored the update_slot() code a bit to be hopefully slightly more
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().

23 years agoPut descr name in "bad memberdescr type" error message.
Jeremy Hylton [Tue, 16 Oct 2001 16:51:56 +0000 (16:51 +0000)]
Put descr name in "bad memberdescr type" error message.

23 years agoAdded information about setprofile() and settrace() hooks being thread-
Fred Drake [Tue, 16 Oct 2001 14:54:22 +0000 (14:54 +0000)]
Added information about setprofile() and settrace() hooks being thread-
specific, and updated some of the comments about the profile hook.
This closes SF bug #471725.

23 years agoFix thinko in a comment about seeking with a file object.
Fred Drake [Tue, 16 Oct 2001 03:25:00 +0000 (03:25 +0000)]
Fix thinko in a comment about seeking with a file object.
Reported by Francesco Trentini.

23 years agoReword the text on the demise of __dynamic__ somewhat, correcting a
Guido van Rossum [Tue, 16 Oct 2001 00:46:57 +0000 (00:46 +0000)]
Reword the text on the demise of __dynamic__ somewhat, correcting a
typo.

23 years agoRemove obsolete __dynamic__ distinction.
Tim Peters [Mon, 15 Oct 2001 22:59:59 +0000 (22:59 +0000)]
Remove obsolete __dynamic__ distinction.

23 years agoRemove obsolete __dynamic__ distinction.
Tim Peters [Mon, 15 Oct 2001 22:53:29 +0000 (22:53 +0000)]
Remove obsolete __dynamic__ distinction.

23 years agoRemove obsolete __static__/__dynamic__ distinction.
Tim Peters [Mon, 15 Oct 2001 22:49:27 +0000 (22:49 +0000)]
Remove obsolete __static__/__dynamic__ distinction.

23 years agopstats-compatible analysis module.
Fred Drake [Mon, 15 Oct 2001 22:18:53 +0000 (22:18 +0000)]
pstats-compatible analysis module.
hotshot.stats.load(logfilename) returns a pstats.Stats instance, which is
about as compatible as it gets.

23 years agoruncall(): Expose the return value of the profiled function; this allows
Fred Drake [Mon, 15 Oct 2001 22:14:29 +0000 (22:14 +0000)]
runcall():  Expose the return value of the profiled function; this allows
    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.

23 years agoRemoved useless code to count the number of calls into the profiler.
Fred Drake [Mon, 15 Oct 2001 22:11:02 +0000 (22:11 +0000)]
Removed useless code to count the number of calls into the profiler.
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.

23 years agoAvoid deep recursion when reading the header of the log file.
Fred Drake [Mon, 15 Oct 2001 22:05:32 +0000 (22:05 +0000)]
Avoid deep recursion when reading the header of the log file.
Add support for extracting function names from the log file, keeping the
extract-names-from-sources support as a fallback.

23 years agoGet rid of __defined__ and tp_defined -- there's no need to
Guido van Rossum [Mon, 15 Oct 2001 22:03:32 +0000 (22:03 +0000)]
Get rid of __defined__ and tp_defined -- there's no need to
distinguish __dict__ and __defined__ any more.  In the C structure,
tp_cache takes its place -- but this hasn't been implemented yet.

23 years agoCovert pickle tests to use unittest.
Jeremy Hylton [Mon, 15 Oct 2001 21:38:56 +0000 (21:38 +0000)]
Covert pickle tests to use unittest.

Extend tests to cover a few more cases.  For cPickle, test several of
the undocumented features.

23 years agoBetter fix for core dumps on recursive objects in fast mode.
Jeremy Hylton [Mon, 15 Oct 2001 21:37:58 +0000 (21:37 +0000)]
Better fix for core dumps on recursive objects in fast mode.

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.

23 years agoUse cStringIO when available.
Jeremy Hylton [Mon, 15 Oct 2001 21:29:28 +0000 (21:29 +0000)]
Use cStringIO when available.

Remove test code.  It's available in Lib/test/picklertester.py.

23 years agoRemove a couple of tp_xxx fields that you are not expected to
Guido van Rossum [Mon, 15 Oct 2001 21:24:12 +0000 (21:24 +0000)]
Remove a couple of tp_xxx fields that you are not expected to
initialize (or use or even know about :-).

23 years agoFix a bunch of warnings reported by Skip.
Guido van Rossum [Mon, 15 Oct 2001 21:12:54 +0000 (21:12 +0000)]
Fix a bunch of warnings reported by Skip.

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.

23 years agoCompletely get rid of __dynamic__ and the corresponding
Guido van Rossum [Mon, 15 Oct 2001 21:05:10 +0000 (21:05 +0000)]
Completely get rid of __dynamic__ and the corresponding
Py_TPFLAGS_DYNAMICTYPE bit.  There is no longer a performance benefit,
and I don't really see the use case any more.

23 years agomake getarray static - it's only called from ceval.c and is not an
Skip Montanaro [Mon, 15 Oct 2001 20:51:38 +0000 (20:51 +0000)]
make getarray static - it's only called from ceval.c and is not an
extern-able name.

23 years agoAnother contributor.
Guido van Rossum [Mon, 15 Oct 2001 19:55:12 +0000 (19:55 +0000)]
Another contributor.

23 years agoAdd (void *) casts to solve some problems on HP-UX 11.0, as discussed
Guido van Rossum [Mon, 15 Oct 2001 19:44:24 +0000 (19:44 +0000)]
Add (void *) casts to solve some problems on HP-UX 11.0, as discussed
on SF bug #467145.

23 years agoPatch 471400: escape single-dot lines; by Jason Hildebrand.
Guido van Rossum [Mon, 15 Oct 2001 18:44:26 +0000 (18:44 +0000)]
Patch 471400: escape single-dot lines; by Jason Hildebrand.

RFC 2049 recommends never outputting a line consisting of a single
dot.

23 years agoUse an assert() for the REQ() macro instead of making up our own
Guido van Rossum [Mon, 15 Oct 2001 17:23:13 +0000 (17:23 +0000)]
Use an assert() for the REQ() macro instead of making up our own
assertion.

23 years agoNote about fix in list comprehensions.
Guido van Rossum [Mon, 15 Oct 2001 15:53:58 +0000 (15:53 +0000)]
Note about fix in list comprehensions.

23 years agoVery subtle syntax change: in a list comprehension, the testlist in
Guido van Rossum [Mon, 15 Oct 2001 15:44:05 +0000 (15:44 +0000)]
Very subtle syntax change: in a list comprehension, the testlist in
"for <var> in <testlist> may no longer be a single test followed by
a comma.  This solves SF bug #431886.  Note that if the testlist
contains more than one test, a trailing comma is still allowed, for
maximum backward compatibility; but this example is not:

    [(x, y) for x in range(10), for y in range(10)]
                              ^

The fix involved creating a new nonterminal 'testlist_safe' whose
definition doesn't allow the trailing comma if there's only one test:

    testlist_safe: test [(',' test)+ [',']]

23 years agoDo not define _POSIX_THREADS if unistd.h defines it.
Martin v. Löwis [Mon, 15 Oct 2001 14:34:42 +0000 (14:34 +0000)]
Do not define _POSIX_THREADS if unistd.h defines it.
Check for pthread_sigmask before using it. Fixes remaining problem in #470781.

23 years agoSF bug #469910 by Alfonso Baciero: Bugfix for imaplib for macintosh
Guido van Rossum [Mon, 15 Oct 2001 13:47:08 +0000 (13:47 +0000)]
SF bug #469910 by Alfonso Baciero: Bugfix for imaplib for macintosh

Pass binary mode to makefile().

23 years agoAdded notes to clarify that binascii.crc32(), zlib.crc32(), and
Fred Drake [Mon, 15 Oct 2001 13:45:49 +0000 (13:45 +0000)]
Added notes to clarify that binascii.crc32(), zlib.crc32(), and
zlib.adler32() are not suitable as general hash functions.

23 years agoCheck whether pthreads are available without any options before checking
Martin v. Löwis [Mon, 15 Oct 2001 08:06:29 +0000 (08:06 +0000)]
Check whether pthreads are available without any options before checking
that -Kpthread is supported. Fixes #470781.
Port to autoconf 2.52.

23 years agotest_typed_subpart_iterator_default_type(): Test for when the message
Barry Warsaw [Mon, 15 Oct 2001 04:39:02 +0000 (04:39 +0000)]
test_typed_subpart_iterator_default_type(): Test for when the message
has no Content-Type: header, it should be treated as text/plain.

23 years agotyped_subpart_iterator(): When getting the main type use 'text' as the
Barry Warsaw [Mon, 15 Oct 2001 04:38:22 +0000 (04:38 +0000)]
typed_subpart_iterator(): When getting the main type use 'text' as the
failobj, and when getting the subtype use 'plain' as the failobj.
text/plain is supposed to be the default if the message contains no
Content-Type: header.

23 years agoAdded documentation for the functions listed in marshal.h.
Fred Drake [Sun, 14 Oct 2001 04:45:51 +0000 (04:45 +0000)]
Added documentation for the functions listed in marshal.h.
Prompted by Jim Ahlstrom.  This closes SF patch #470614.

23 years agoAn MSVC makefile to rebuild the grammar files (graminit.[ch]) manually.
Tim Peters [Sat, 13 Oct 2001 20:16:17 +0000 (20:16 +0000)]
An MSVC makefile to rebuild the grammar files (graminit.[ch]) manually.
Ugly, but it works.

23 years agoRedid the slot computation. The initial slot assignments are now done
Guido van Rossum [Sat, 13 Oct 2001 20:02:41 +0000 (20:02 +0000)]
Redid the slot computation.  The initial slot assignments are now done
using the same algorithm as the slot updates.  The slotdefs array is
now sorted by slot offset and has an interned string object corresponding
to the name added to each item.  More can be done but I need to commit
this first as a working intermediate stage.

23 years ago"ib" should be "boundary"; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:38:53 +0000 (18:38 +0000)]
"ib" should be "boundary"; reported by Neal Norwitz.

23 years agoAdded missing parameter in call to http_error_default();
Fred Drake [Sat, 13 Oct 2001 18:37:07 +0000 (18:37 +0000)]
Added missing parameter in call to http_error_default();
reported by Neal Norwitz.

23 years agoSMTPError should be SMTPException; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:35:32 +0000 (18:35 +0000)]
SMTPError should be SMTPException; reported by Neal Norwitz.

23 years agoIgnore execfile() return value; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:34:42 +0000 (18:34 +0000)]
Ignore execfile() return value; reported by Neal Norwitz.

23 years ago"f" should be "self"; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 18:33:51 +0000 (18:33 +0000)]
"f" should be "self"; reported by Neal Norwitz.

23 years ago_os should be os; reported by Neal Norwitz.
Fred Drake [Sat, 13 Oct 2001 16:00:52 +0000 (16:00 +0000)]
_os should be os; reported by Neal Norwitz.

23 years agoRemove extra param from call to self.error().
Fred Drake [Sat, 13 Oct 2001 15:59:47 +0000 (15:59 +0000)]
Remove extra param from call to self.error().
Reported by Neal Norwitz.

23 years agoRemove extra "]" in splitlines() docstring.
Fred Drake [Sat, 13 Oct 2001 15:57:55 +0000 (15:57 +0000)]
Remove extra "]" in splitlines() docstring.
Reported by Neal Norwitz.

23 years agoMove grid_location into Misc. Fixes bug #426892.
Martin v. Löwis [Sat, 13 Oct 2001 09:33:51 +0000 (09:33 +0000)]
Move grid_location into Misc. Fixes bug #426892.

23 years agoCheck for term.h and include it on non-ncurses system to get a declaration
Martin v. Löwis [Sat, 13 Oct 2001 09:12:41 +0000 (09:12 +0000)]
Check for term.h and include it on non-ncurses system to get a declaration
for tigetstr.

23 years agoTest for __sun instead of __sun__, since SUNWspro only defines the latter;
Martin v. Löwis [Sat, 13 Oct 2001 09:00:42 +0000 (09:00 +0000)]
Test for __sun instead of __sun__, since SUNWspro only defines the latter;
gcc defines both.

23 years agoCast argument to set_panel_userptr to void*. Fixes bug #417240.
Martin v. Löwis [Sat, 13 Oct 2001 08:50:10 +0000 (08:50 +0000)]
Cast argument to set_panel_userptr to void*. Fixes bug #417240.

23 years agoSpeed the Windows code by using native 64-bit int compiler support instead
Tim Peters [Sat, 13 Oct 2001 07:37:52 +0000 (07:37 +0000)]
Speed the Windows code by using native 64-bit int compiler support instead
of calling external functions.

23 years agoSuppress a bunch of "value computed is not used" warnings when building in
Fred Drake [Sat, 13 Oct 2001 06:11:28 +0000 (06:11 +0000)]
Suppress a bunch of "value computed is not used" warnings when building in
debug mode (--with-pydebug).

23 years agoRemove some unused imports.
Fred Drake [Sat, 13 Oct 2001 03:00:11 +0000 (03:00 +0000)]
Remove some unused imports.
Remove the log file after we are done with it.  This should clean up after
the test even on Windows, since the file is now closed before we attempt
removal.

23 years agoWhen we reach the end of the log file, close the logreader object.
Fred Drake [Sat, 13 Oct 2001 02:55:40 +0000 (02:55 +0000)]
When we reach the end of the log file, close the logreader object.

23 years agoAdded new hotshot pkg to the Windows installer.
Tim Peters [Sat, 13 Oct 2001 00:26:25 +0000 (00:26 +0000)]
Added new hotshot pkg to the Windows installer.
Rearranged the growing number of Lib packages into alphabetical order.

23 years agoYou can't unlink open files on Windows.
Tim Peters [Sat, 13 Oct 2001 00:19:39 +0000 (00:19 +0000)]
You can't unlink open files on Windows.
Simply commented it out, and then test_hotshot passes on Windows.
Leaving to Fred to fix "the right way" (it seems to be a feature of
unittest that all unittests try to unlink open files <wink>).

23 years agoThis compiles on Windows now.
Tim Peters [Sat, 13 Oct 2001 00:14:28 +0000 (00:14 +0000)]
This compiles on Windows now.

23 years agoMy editor can't deal with long backslash-continued strings. Changed 'em.
Tim Peters [Sat, 13 Oct 2001 00:11:10 +0000 (00:11 +0000)]
My editor can't deal with long backslash-continued strings.  Changed 'em.
This still doesn't compile on Windows, but at least I have a shot at
fixing that now.

23 years agoCorrect __repr__: include module name, avoid extra space for empty status,
Martin v. Löwis [Fri, 12 Oct 2001 22:39:20 +0000 (22:39 +0000)]
Correct __repr__: include module name, avoid extra space for empty status,
use 0x format for id. Proposed by Cesar Eduardo Barros in patch #470680.

23 years agoSF patch #467455 : Enhanced environment variables, by Toby Dickenson.
Guido van Rossum [Fri, 12 Oct 2001 22:17:56 +0000 (22:17 +0000)]
SF patch #467455 : Enhanced environment variables, by Toby Dickenson.

   This patch changes to logic to:

   if env.var. set and non-empty:
       if env.var. is an integer:
           set flag to that integer
   if flag is zero: # [actually, <= 0 --GvR]
       set flag to 1

   Under this patch, anyone currently using
   PYTHONVERBOSE=yes will get the same output as before.

   PYTHONVERBNOSE=2 will generate more verbosity than
   before.

   The only unusual case that the following three are
   still all equivalent:
   PYTHONVERBOSE=yespleas
   PYTHONVERBOSE=1
   PYTHONVERBOSE=0

23 years agoGet hotshot closer to compiling on Windows.
Tim Peters [Fri, 12 Oct 2001 22:08:39 +0000 (22:08 +0000)]
Get hotshot closer to compiling on Windows.
Still broken:  GETTIMEOFDAY.  This macro obviously isn't being defined
on Windows, so there's logic errors here I'd rather Fred untangled.

23 years agoJason Lowe
Guido van Rossum [Fri, 12 Oct 2001 21:54:29 +0000 (21:54 +0000)]
Jason Lowe

23 years agoAdd SF patch #468347 -- mask signals for non-main pthreads, by Jason Lowe:
Guido van Rossum [Fri, 12 Oct 2001 21:49:17 +0000 (21:49 +0000)]
Add SF patch #468347 -- mask signals for non-main pthreads, by Jason Lowe:

   This patch updates Python/thread_pthread.h to mask all
   signals for any thread created. This will keep all
   signals masked for any thread that isn't the initial
   thread. For Solaris and Linux, the two platforms I was
   able to test it on, it solves bug #465673 (pthreads
   need signal protection) and probably will solve bug
   #219772 (Interactive InterPreter+ Thread -> core dump
   at exit).

   I'd be great if this could get some testing on other
   platforms, especially HP-UX pre 11.00 and post 11.00,
   as I had to make some guesses for the DCE thread case.
   AIX is also a concern as I saw some mention of using
   sigthreadmask() as a pthread_sigmask() equivalent, but
   this patch doesn't use sigthreadmask(). I don't have
   access to AIX.

23 years agoAdd entry for HotShot.
Fred Drake [Fri, 12 Oct 2001 21:00:48 +0000 (21:00 +0000)]
Add entry for HotShot.

23 years agoThe HotShot core: look, ma, no hands!
Fred Drake [Fri, 12 Oct 2001 20:57:55 +0000 (20:57 +0000)]
The HotShot core:  look, ma, no hands!

23 years agoPreliminary user-level interface to HotShot. We still need the analysis
Fred Drake [Fri, 12 Oct 2001 20:56:29 +0000 (20:56 +0000)]
Preliminary user-level interface to HotShot.  We still need the analysis
tool; look for that on Monday.

23 years agoA most trivial test for HotShot -- make sure we get reasonable events
Fred Drake [Fri, 12 Oct 2001 20:53:59 +0000 (20:53 +0000)]
A most trivial test for HotShot -- make sure we get reasonable events
reported and can read the log back in.

23 years agoUse double curly braces for the generation0/1/2 initializers, to shut
Guido van Rossum [Fri, 12 Oct 2001 20:52:48 +0000 (20:52 +0000)]
Use double curly braces for the generation0/1/2 initializers, to shut
up GCC warnings.

23 years agoBand-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's.
Guido van Rossum [Fri, 12 Oct 2001 20:01:53 +0000 (20:01 +0000)]
Band-aid solution to SF bug #470634: readlines() on linux requires 2 ^D's.

The problem is that if fread() returns a short count, we attempt
another fread() the next time through the loop, and apparently glibc
clears or ignores the eof condition so the second fread() requires
another ^D to make it see the eof condition.

According to the man page (and the C std, I hope) fread() can only
return a short count on error or eof.  I'm using that in the band-aid
solution to avoid calling fread() a second time after a short read.

Note that xreadlines() still has this problem: it calls
readlines(sizehint) until it gets a zero-length return.  Since
xreadlines() is mostly used for reading real files, I won't worry
about this until we get a bug report.

23 years agoAdd entries for the newly split C API manual.
Fred Drake [Fri, 12 Oct 2001 19:02:35 +0000 (19:02 +0000)]
Add entries for the newly split C API manual.

23 years agoBreak the Python/C API manual into smaller files by chapter. This manual
Fred Drake [Fri, 12 Oct 2001 19:01:43 +0000 (19:01 +0000)]
Break the Python/C API manual into smaller files by chapter.  This manual
has grown beyond what font-lock will work with using the default (X)Emacs
settings.

Indentation of the description has been made consistent, and a number of
smaller markup adjustments have been made as well.

23 years agoPySocket_getaddrinfo(): fix two refcount bugs, both having to do with
Guido van Rossum [Fri, 12 Oct 2001 18:59:27 +0000 (18:59 +0000)]
PySocket_getaddrinfo(): fix two refcount bugs, both having to do with
a misunderstanding of the refcont behavior of the 'O' format code in
PyArg_ParseTuple() and Py_BuildValue(), respectively.

- pobj is only a borrowed reference, so should *not* be DECREF'ed at
  the end.  This was the cause of SF bug #470635.

- The Py_BuildValue() call would leak the object produced by
  makesockaddr().  (I found this by eyeballing the code.)

23 years agoThe dynamic performance hack is (mostly) done.
Guido van Rossum [Fri, 12 Oct 2001 17:43:43 +0000 (17:43 +0000)]
The dynamic performance hack is (mostly) done.

23 years agoSuggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
Guido van Rossum [Fri, 12 Oct 2001 15:34:29 +0000 (15:34 +0000)]
Suggestion from SF patch #470433 to avoid clobbering TCL_LIBRARY et
al. if already set.  Also adds TIX_LIBRARY (just in case).
(Note that this is entirely Windows specific.)

23 years agoNow that COPYBUF is a new local macro, add #undef COPYBUF.
Guido van Rossum [Fri, 12 Oct 2001 14:13:21 +0000 (14:13 +0000)]
Now that COPYBUF is a new local macro, add #undef COPYBUF.