]> granicus.if.org Git - python/log
python
22 years agoReturn NULL instead of 0 from function with a pointer return value.
Fred Drake [Fri, 19 Jul 2002 22:03:03 +0000 (22:03 +0000)]
Return NULL instead of 0 from function with a pointer return value.

22 years agoAlas, roll back the definition of _XOPEN_SOURCE. It breaks the tests
Guido van Rossum [Fri, 19 Jul 2002 19:32:30 +0000 (19:32 +0000)]
Alas, roll back the definition of _XOPEN_SOURCE.  It breaks the tests
for the time module, because somehow configure won't define the
symbols HAVE_STRUCT_TM_TM_ZONE, HAVE_TM_ZONE, and HAVE_TZNAME in this
case.

I've got no time to research this further, so I leave it in Jeremy and
Martin's capable hands to find a different solution for True64 (or to
devise a way to get the time tests to succeed while defining
_XOPEN_SOURCE).

22 years agoRemove a few lines that aren't used and cause problems on platforms
Guido van Rossum [Fri, 19 Jul 2002 19:23:54 +0000 (19:23 +0000)]
Remove a few lines that aren't used and cause problems on platforms
where recvfrom() on a TCP stream returns None for the address.
This should address the remaining problems on FreeBSD.

22 years agoPure Python strptime implementation by Brett Cannon. See SF patch 474274.
Neal Norwitz [Fri, 19 Jul 2002 18:38:25 +0000 (18:38 +0000)]
Pure Python strptime implementation by Brett Cannon.  See SF patch 474274.

22 years agoDoc patch from SF 474274 (pure Python strptime by Brett Cannon).
Guido van Rossum [Fri, 19 Jul 2002 17:09:36 +0000 (17:09 +0000)]
Doc patch from SF 474274 (pure Python strptime by Brett Cannon).

22 years agoPatch to call the Pure python strptime implementation if there's no
Guido van Rossum [Fri, 19 Jul 2002 17:06:47 +0000 (17:06 +0000)]
Patch to call the Pure python strptime implementation if there's no
C implementation.  See SF patch 474274, by Brett Cannon.

(As an experiment, I'm adding a line that #undefs HAVE_STRPTIME,
so that you'll always get the Python version.  This is so that it
gets some good exercise.  We should eventually delete that line.)

22 years agoPure Python strptime implementation by Brett Cannon. See SF patch 474274.
Guido van Rossum [Fri, 19 Jul 2002 17:04:46 +0000 (17:04 +0000)]
Pure Python strptime implementation by Brett Cannon.  See SF patch 474274.
Also adds tests.

22 years agoSilly typo. Not sure how that got in.
Michael W. Hudson [Fri, 19 Jul 2002 15:52:38 +0000 (15:52 +0000)]
Silly typo.  Not sure how that got in.

22 years agoSubstantially flesh out extended slice section. I think this is probably
Michael W. Hudson [Fri, 19 Jul 2002 15:48:56 +0000 (15:48 +0000)]
Substantially flesh out extended slice section.  I think this is probably
done now.

22 years agoA few days ago, Guido said (in the thread "[Python-Dev] Python
Michael W. Hudson [Fri, 19 Jul 2002 15:47:06 +0000 (15:47 +0000)]
A few days ago, Guido said (in the thread "[Python-Dev] Python
version of PySlice_GetIndicesEx"):

> OK.  Michael, if you want to check in indices(), go ahead.

Then I did what was needed, but didn't check it in.  Here it is.

22 years agoAdd test for previous core dump when sending on closed socket with
Guido van Rossum [Fri, 19 Jul 2002 12:46:46 +0000 (12:46 +0000)]
Add test for previous core dump when sending on closed socket with
timeout.

Added small sleeps to _testAccept() and _testRecv() in
NonBlockingTCPTests, to reduce race conditions (I know, this is not
the solution!)

22 years agoBail out early from internal_select() when socket file descriptor
Guido van Rossum [Fri, 19 Jul 2002 12:44:59 +0000 (12:44 +0000)]
Bail out early from internal_select() when socket file descriptor
closed.  Prevents core dump.

22 years agoMore sort cleanup: Moved the special cases from samplesortslice into
Tim Peters [Fri, 19 Jul 2002 07:05:44 +0000 (07:05 +0000)]
More sort cleanup:  Moved the special cases from samplesortslice into
listsort.  If the former calls itself recursively, they're a waste of
time, since it's called on a random permutation of a random subset of
elements.  OTOH, for exactly the same reason, they're an immeasurably
small waste of time (the odds of finding exploitable order in a random
permutation are ~= 0, so the special-case loops looking for order give
up quickly).  The point is more for conceptual clarity.
Also changed some "assert comments" into real asserts; when this code
was first written, Python.h didn't supply assert.h.

22 years agoLand Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.
Mark Hammond [Fri, 19 Jul 2002 06:55:41 +0000 (06:55 +0000)]
Land Patch [ 566100 ] Rationalize DL_IMPORT and DL_EXPORT.

22 years agoAdd description for _XOPEN_SOURCE_ - needed to allow autoheader to succeed.
Mark Hammond [Fri, 19 Jul 2002 06:31:24 +0000 (06:31 +0000)]
Add description for _XOPEN_SOURCE_ - needed to allow autoheader to succeed.

22 years agobinarysort() cleanup: Documented the key invariants, explained why they
Tim Peters [Fri, 19 Jul 2002 06:12:32 +0000 (06:12 +0000)]
binarysort() cleanup:  Documented the key invariants, explained why they
imply this is a stable sort, and added some asserts.

22 years agolistreverse(): Don't call the new reverse_slice unless the list
Tim Peters [Fri, 19 Jul 2002 04:04:16 +0000 (04:04 +0000)]
listreverse():  Don't call the new reverse_slice unless the list
has something in it (else ob_item may be a NULL pointer).

22 years agoCleanup yielding a small speed boost: before rich comparisons were
Tim Peters [Fri, 19 Jul 2002 03:30:57 +0000 (03:30 +0000)]
Cleanup yielding a small speed boost:  before rich comparisons were
introduced, list.sort() was rewritten to use only the "< or not <?"
distinction.  After rich comparisons were introduced, docompare() was
fiddled to translate a Py_LT Boolean result into the old "-1 for <,
0 for ==, 1 for >" flavor of outcome, and the sorting code was left
alone.  This left things more obscure than they should be, and turns
out it also cost measurable cycles.

So:  The old CMPERROR novelty is gone.  docompare() is renamed to islt(),
and now has the same return conditinos as PyObject_RichCompareBool.  The
SETK macro is renamed to ISLT, and is even weirder than before (don't
complain unless you want to maintain the sort code <wink>).

Overall, this yields a 1-2% speedup in the usual (no explicit function
passed to list.sort()) case when sorting arrays of floats (as sortperf.py
does).  The boost is higher for arrays of ints.

22 years agoTrimmed trailing whitespace.
Tim Peters [Fri, 19 Jul 2002 02:35:45 +0000 (02:35 +0000)]
Trimmed trailing whitespace.

22 years agoCleanup: Define one internal utility for reversing a list slice, and
Tim Peters [Fri, 19 Jul 2002 02:33:08 +0000 (02:33 +0000)]
Cleanup:  Define one internal utility for reversing a list slice, and
use that everywhere.

22 years agoAnthony Baxter's cleanup patch. Python project SF patch # 583190,
Barry Warsaw [Thu, 18 Jul 2002 23:09:09 +0000 (23:09 +0000)]
Anthony Baxter's cleanup patch.  Python project SF patch # 583190,
quoting:

  in non-strict mode, messages don't require a blank line at the end
  with a missing end-terminator. A single newline is sufficient now.

  Handle trailing whitespace at the end of a boundary. Had to switch
  from using string.split() to re.split()

  Handle whitespace on the end of a parameter list for Content-type.

  Handle whitespace on the end of a plain content-type header.

Specifically,

get_type(): Strip the content type string.

_get_params_preserve(): Strip the parameter names and values on both
sides.

_parsebody(): Lots of changes as described above, with some stylistic
changes by Barry (who hopefully didn't screw things up ;).

22 years agoFix bug [ 549731 ] Unicode encoders appears to leak references.
Mark Hammond [Thu, 18 Jul 2002 23:06:17 +0000 (23:06 +0000)]
Fix bug [ 549731 ] Unicode encoders appears to leak references.

Python 2.2.1 bugfix candidate.

22 years agoDefine _XOPEN_SOURCE in configure and Python.h.
Jeremy Hylton [Thu, 18 Jul 2002 22:39:34 +0000 (22:39 +0000)]
Define _XOPEN_SOURCE in configure and Python.h.

This gets compilation of posixmodule.c to succeed on Tru64 and does no
harm on Linux.  We may need to undefine it on some platforms, but
let's wait and see.

Martin says:

> I think it is generally the right thing to define _XOPEN_SOURCE on
> Unix, providing a negative list of systems that cannot support this
> setting (or preferably solving whatever problems remain).
>
> I'd put an (unconditional) AC_DEFINE into configure.in early on; it
> *should* go into confdefs.h as configure proceeds, and thus be active
> when other tests are performed.

22 years agoA Python float is a C double; redeclare defaulttimeout as such; stops
Tim Peters [Thu, 18 Jul 2002 22:38:44 +0000 (22:38 +0000)]
A Python float is a C double; redeclare defaulttimeout as such; stops
compiler wngs on Windows.

22 years agoAnthony Baxter's patch to expose the parser's `strict' flag in these
Barry Warsaw [Thu, 18 Jul 2002 21:29:17 +0000 (21:29 +0000)]
Anthony Baxter's patch to expose the parser's `strict' flag in these
convenience functions.  Closes SF # 583188 (python project).

22 years agoSilence warning about getdefaulttimeout in PyMethodDef.
Guido van Rossum [Thu, 18 Jul 2002 21:11:26 +0000 (21:11 +0000)]
Silence warning about getdefaulttimeout in PyMethodDef.

22 years agoFix indentation.
Jeremy Hylton [Thu, 18 Jul 2002 20:58:57 +0000 (20:58 +0000)]
Fix indentation.

22 years agoUse AC_FUNC_SETPGRP.
Jeremy Hylton [Thu, 18 Jul 2002 20:25:46 +0000 (20:25 +0000)]
Use AC_FUNC_SETPGRP.

22 years agoAdd clarifying comment.
Guido van Rossum [Thu, 18 Jul 2002 19:48:46 +0000 (19:48 +0000)]
Add clarifying comment.

22 years agoScript to run the pystones "benchmark" under HotShot.
Fred Drake [Thu, 18 Jul 2002 19:47:05 +0000 (19:47 +0000)]
Script to run the pystones "benchmark" under HotShot.

22 years agoSimplify; the low-level log reader is now always a modern iterator,
Fred Drake [Thu, 18 Jul 2002 19:20:23 +0000 (19:20 +0000)]
Simplify; the low-level log reader is now always a modern iterator,
and should never return None.  (It only did this for an old version of
HotShot that was trying to still work with a patched Python 2.1.)

22 years agoExpose the fileno() method of the underlying profiler.
Fred Drake [Thu, 18 Jul 2002 19:17:54 +0000 (19:17 +0000)]
Expose the fileno() method of the underlying profiler.

22 years agoExpose the fileno() method of the underlying log reader.
Fred Drake [Thu, 18 Jul 2002 19:17:20 +0000 (19:17 +0000)]
Expose the fileno() method of the underlying log reader.

Remove the crufty support for Python's that don't have StopIteration;
the HotShot patch for Python 2.1 has not been maintained.

22 years ago- When the log reader detects end-of-file, close the file.
Fred Drake [Thu, 18 Jul 2002 19:11:44 +0000 (19:11 +0000)]
- When the log reader detects end-of-file, close the file.
- The log reader now provides a "closed" attribute similar to the
  profiler.
- Both the profiler and log reader now provide a fileno() method.
- Use METH_NOARGS where possible, allowing simpler code in the method
  implementations.

22 years agoRemove extraneous semicolon.
Jeremy Hylton [Thu, 18 Jul 2002 18:49:52 +0000 (18:49 +0000)]
Remove extraneous semicolon.

(Silences compiler warning for Compaq C++ 6.5 on Tru64.)

22 years agoAdd default timeout functionality. This adds setdefaulttimeout() and
Guido van Rossum [Thu, 18 Jul 2002 17:08:35 +0000 (17:08 +0000)]
Add default timeout functionality.  This adds setdefaulttimeout() and
getdefaulttimeout() functions to the socket and _socket modules, and
appropriate tests.

22 years agoGave this a facelift: "/" vs "//", whrandom vs random, etc. Boosted
Tim Peters [Thu, 18 Jul 2002 15:53:32 +0000 (15:53 +0000)]
Gave this a facelift:  "/" vs "//", whrandom vs random, etc.  Boosted
the default range to end at 2**20 (machines are much faster now).
Fixed what was quite a arguably a bug, explaining an old mystery:  the
"!sort" case here contructs what *was* a quadratic-time disaster for
the old quicksort implementation.  But under the current samplesort, it
always ran much faster than *sort (the random case).  This never made
sense.  Turns out it was because !sort was sorting an integer array,
while all the other cases sort floats; and comparing ints goes much
quicker than comparing floats in Python.  After changing !sort to chew
on floats instead, it's now slower than the random sort case, which
makes more sense (but is just a few percent slower; samplesort is
massively less sensitive to "bad patterns" than quicksort).

22 years agoGave hotshot.LogReader a close() method, to allow users to close the
Tim Peters [Thu, 18 Jul 2002 14:54:28 +0000 (14:54 +0000)]
Gave hotshot.LogReader a close() method, to allow users to close the
file object that LogReader opens.  Used it then in test_hotshot; the
test passes again on Windows.  Thank Guido for the analysis.

22 years agoWe're no longer trying to support older Python versions with this
Guido van Rossum [Thu, 18 Jul 2002 14:33:14 +0000 (14:33 +0000)]
We're no longer trying to support older Python versions with this
codebase, so get rid of the pre-2.2 contingency.

22 years agotest_hotshot fails on Windows now. Added XXX comment explaining why,
Tim Peters [Wed, 17 Jul 2002 23:52:58 +0000 (23:52 +0000)]
test_hotshot fails on Windows now.  Added XXX comment explaining why,
and that I don't know how to fix it.  Fred?

22 years ago(py-pychecker-run): Use the last pychecker invocation as the default
Barry Warsaw [Wed, 17 Jul 2002 21:25:43 +0000 (21:25 +0000)]
(py-pychecker-run): Use the last pychecker invocation as the default
contents of the next command.

22 years agoAdded documentation for the buffer_text and related attributes of the
Fred Drake [Wed, 17 Jul 2002 20:31:52 +0000 (20:31 +0000)]
Added documentation for the buffer_text and related attributes of the
xmlparser object provided by pyexpat, new in Python 2.3.

22 years agoMark the closed attribute of the profiler with PyDoc_STR(), and added
Fred Drake [Wed, 17 Jul 2002 19:38:05 +0000 (19:38 +0000)]
Mark the closed attribute of the profiler with PyDoc_STR(), and added
a docstring for the info attribute of the logreader object.

22 years agoAdded a docstring for the closed attribute.
Fred Drake [Wed, 17 Jul 2002 18:54:20 +0000 (18:54 +0000)]
Added a docstring for the closed attribute.

write_header():  When we encounter a non-string object in sys.path, record
    a fairly mindless placeholder rather than dying.  Possibly could record
    the repr of the object found, but not clear whether that matters.

22 years agoSF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
Guido van Rossum [Wed, 17 Jul 2002 16:57:13 +0000 (16:57 +0000)]
SF patch 552161 - Py_AddPendingCall doesn't unlock on fail (Daniel
Dunbar)

Can't test this, but looks correct to me.

22 years agoRemoved more stray instances of statichere, but left _sre.c alone.
Tim Peters [Wed, 17 Jul 2002 16:49:03 +0000 (16:49 +0000)]
Removed more stray instances of statichere, but left _sre.c alone.

22 years agoChange staticforward and statichere to just use static.
Fred Drake [Wed, 17 Jul 2002 16:42:48 +0000 (16:42 +0000)]
Change staticforward and statichere to just use static.
Removed ^M from some line-ends.

22 years agoRemove now-obsolete staticforward/statichere discussion.
Fred Drake [Wed, 17 Jul 2002 16:40:39 +0000 (16:40 +0000)]
Remove now-obsolete staticforward/statichere discussion.

22 years agostaticforward bites the dust.
Jeremy Hylton [Wed, 17 Jul 2002 16:30:39 +0000 (16:30 +0000)]
staticforward bites the dust.

The staticforward define was needed to support certain broken C
compilers (notably SCO ODT 3.0, perhaps early AIX as well) botched the
static keyword when it was used with a forward declaration of a static
initialized structure.  Standard C allows the forward declaration with
static, and we've decided to stop catering to broken C compilers.  (In
fact, we expect that the compilers are all fixed eight years later.)

I'm leaving staticforward and statichere defined in object.h as
static.  This is only for backwards compatibility with C extensions
that might still use it.

XXX I haven't updated the documentation.

22 years agoSome modernization. Get rid of the redundant next() method. Always
Guido van Rossum [Wed, 17 Jul 2002 16:15:35 +0000 (16:15 +0000)]
Some modernization.  Get rid of the redundant next() method.  Always
assume tp_iter and later fields exist.  Use PyObject_GenericGetAttr
instead of providing our own tp_getattr hook.

22 years agoAdd a test for the 'closed' attribute on the C-profiler object.
Guido van Rossum [Wed, 17 Jul 2002 16:12:53 +0000 (16:12 +0000)]
Add a test for the 'closed' attribute on the C-profiler object.

22 years agoAdd missing comma.
Jeremy Hylton [Wed, 17 Jul 2002 15:56:55 +0000 (15:56 +0000)]
Add missing comma.

22 years agoAdd test_zlib and test_struct to list of slow tests
Jeremy Hylton [Wed, 17 Jul 2002 15:55:09 +0000 (15:55 +0000)]
Add test_zlib and test_struct to list of slow tests

22 years agoWindows has no actual need for BAD_STATIC_FORWARD, so got rid of it.
Tim Peters [Wed, 17 Jul 2002 15:32:40 +0000 (15:32 +0000)]
Windows has no actual need for BAD_STATIC_FORWARD, so got rid of it.

22 years agoAdd a rather generous set of tests allowed to be skipped on sunos5.
Guido van Rossum [Wed, 17 Jul 2002 15:08:24 +0000 (15:08 +0000)]
Add a rather generous set of tests allowed to be skipped on sunos5.

22 years agoRemove RCSId; this produces annoying warnings.
Fred Drake [Wed, 17 Jul 2002 14:45:33 +0000 (14:45 +0000)]
Remove RCSId; this produces annoying warnings.
This is already removed from Expat 1.95.4, so the problem will not
recur when we update.

22 years agoWipe out some warnings about non-ANSI code and an unsafe arg to
Guido van Rossum [Wed, 17 Jul 2002 14:33:34 +0000 (14:33 +0000)]
Wipe out some warnings about non-ANSI code and an unsafe arg to
isdigit().

22 years agoreduce(): Clarified what is returned in the case of a sequence 1 item long and
Fred Drake [Wed, 17 Jul 2002 13:55:33 +0000 (13:55 +0000)]
reduce(): Clarified what is returned in the case of a sequence 1 item long and
initial/default value.

22 years agoWe need to (require 'compile) to guarantee that compile-internal is
Barry Warsaw [Wed, 17 Jul 2002 13:45:00 +0000 (13:45 +0000)]
We need to (require 'compile) to guarantee that compile-internal is
defined.  /Really/ closes SF # 580631.

22 years agoUse sys.executable to run Python, as suggested by Neal Norwitz.
Tim Peters [Wed, 17 Jul 2002 00:34:26 +0000 (00:34 +0000)]
Use sys.executable to run Python, as suggested by Neal Norwitz.

22 years agoThere's no need for generators to define an explicit next() method.
Tim Peters [Wed, 17 Jul 2002 00:15:22 +0000 (00:15 +0000)]
There's no need for generators to define an explicit next() method.

22 years agoBunch of tests to make sure that StopIteration is a sink state.
Guido van Rossum [Tue, 16 Jul 2002 21:48:11 +0000 (21:48 +0000)]
Bunch of tests to make sure that StopIteration is a sink state.

22 years agoFix typos and such caught by the pycheckerbot.
Jeremy Hylton [Tue, 16 Jul 2002 21:41:43 +0000 (21:41 +0000)]
Fix typos and such caught by the pycheckerbot.

22 years agoWhitespace normalization.
Tim Peters [Tue, 16 Jul 2002 21:35:23 +0000 (21:35 +0000)]
Whitespace normalization.

22 years agoSend HTTP requests with a single send() call instead of many.
Jeremy Hylton [Tue, 16 Jul 2002 21:21:11 +0000 (21:21 +0000)]
Send HTTP requests with a single send() call instead of many.

The implementation now stores all the lines of the request in a buffer
and makes a single send() call when the request is finished,
specifically when endheaders() is called.

This appears to improve performance.  The old code called send() for
each line.  The sends are all short, so they caused bad interactions
with the Nagle algorithm and delayed acknowledgements.  In simple
tests, the second packet was delayed by 100s of ms.  The second send was
delayed by the Nagle algorithm, waiting for the ack.  The delayed ack
strategy delays the ack in hopes of piggybacking it on a data packet,
but the server won't send any data until it receives the complete
request.

This change minimizes the problem that Nagle + delayed ack will cause
a problem, although a request large enough to be broken into two
packets will still suffer some delay.  Luckily the MSS is large enough
to accomodate most single packets.

XXX Bug fix candidate?

22 years agoRemove the next() method -- one is supplied automatically by
Guido van Rossum [Tue, 16 Jul 2002 21:02:42 +0000 (21:02 +0000)]
Remove the next() method -- one is supplied automatically by
PyType_Ready() because the tp_iternext slot is set (fortunately,
because using the tp_iternext implementation for the the next()
implementation is buggy).  Also changed the allocation order in
enum_next() so that the underlying iterator is only moved ahead when
we have successfully allocated the result tuple and index.

22 years agoRemove the next() method -- one is supplied automatically by
Guido van Rossum [Tue, 16 Jul 2002 20:47:50 +0000 (20:47 +0000)]
Remove the next() method -- one is supplied automatically by
PyType_Ready() because the tp_iternext slot is set.  Also removed the
redundant (and expensive!) call to raise StopIteration from
rangeiter_next().

22 years agoMake StopIteration a sink state. This is done by clearing out the
Guido van Rossum [Tue, 16 Jul 2002 20:30:22 +0000 (20:30 +0000)]
Make StopIteration a sink state.  This is done by clearing out the
di_dict field when the end of the list is reached.  Also make the
error ("dictionary changed size during iteration") a sticky state.

Also remove the next() method -- one is supplied automatically by
PyType_Ready() because the tp_iternext slot is set.  That's a good
thing, because the implementation given here was buggy (it never
raised StopIteration).

22 years agoMake StopIteration a sink state. This is done by clearing out the
Guido van Rossum [Tue, 16 Jul 2002 20:24:46 +0000 (20:24 +0000)]
Make StopIteration a sink state.  This is done by clearing out the
object references (it_seq for seqiterobject, it_callable and
it_sentinel for calliterobject) when the end of the list is reached.

Also remove the next() methods -- one is supplied automatically by
PyType_Ready() because the tp_iternext slot is set.  That's a good
thing, because the implementation given here was buggy (it never
raised StopIteration).

22 years agoWhitespace normalization.
Guido van Rossum [Tue, 16 Jul 2002 20:10:23 +0000 (20:10 +0000)]
Whitespace normalization.

22 years agoMake StopIteration a sink state. This is done by clearing out the
Guido van Rossum [Tue, 16 Jul 2002 20:07:32 +0000 (20:07 +0000)]
Make StopIteration a sink state.  This is done by clearing out the
it_seq field when the end of the list is reached.

Also remove the next() method -- one is supplied automatically by
PyType_Ready() because the tp_iternext slot is set.  That's a good
thing, because the implementation given here was buggy (it never
raised StopIteration).

22 years agoRecord the decision that StopIteration is a sink state (see recent
Guido van Rossum [Tue, 16 Jul 2002 19:53:39 +0000 (19:53 +0000)]
Record the decision that StopIteration is a sink state (see recent
discussion in python-dev with subject "Termination of two-arg iter()").

Implementation will follow.

22 years agoGiven the persistent id code a shot at a class before calling save_global().
Jeremy Hylton [Tue, 16 Jul 2002 19:47:43 +0000 (19:47 +0000)]
Given the persistent id code a shot at a class before calling save_global().

Some persistent picklers (well, probably, the *only* persistent
pickler) would like to pickle some classes in a special way.

22 years agoThe object returned by tp_new() may not have a tp_init.
Jeremy Hylton [Tue, 16 Jul 2002 19:39:38 +0000 (19:39 +0000)]
The object returned by tp_new() may not have a tp_init.

If the object is an ExtensionClass, for example, the slot is not even
defined.  So we must check that the type has the slot (implied by
HAVE_CLASS) before calling tp_init().

22 years agoThe atexit module effectively turned itself off if sys.exitfunc already
Tim Peters [Tue, 16 Jul 2002 19:30:59 +0000 (19:30 +0000)]
The atexit module effectively turned itself off if sys.exitfunc already
existed at the time atexit first got imported.  That's a bug, and this
fixes it.

Also reworked test_atexit.py to test for this too, and to stop using
an "expected output" file, and to test what actually happens at exit
instead of just simulating what it thinks atexit will do at exit.

Bugfix candidate, but it's messy so I'll backport to 2.2 myself.

22 years ago(py-imenu-create-index-function): Skip over stuff that looks like code
Barry Warsaw [Tue, 16 Jul 2002 16:04:13 +0000 (16:04 +0000)]
(py-imenu-create-index-function): Skip over stuff that looks like code
but which is in a comment or string.  Closes SF bug # 572341 reported
by Adrian van den Dries.

22 years agoMake list_iter() really static.
Guido van Rossum [Tue, 16 Jul 2002 15:56:52 +0000 (15:56 +0000)]
Make list_iter() really static.

22 years ago(py-pychecker-run): Thomas Heller points out that this function messes
Barry Warsaw [Tue, 16 Jul 2002 15:56:28 +0000 (15:56 +0000)]
(py-pychecker-run): Thomas Heller points out that this function messes
up the compile command's history.  Fix that by using compile-internal.

Fixes SF bug # 580631

22 years agovalid_identifier(): use an unsigned char* so that isalpha() will do
Guido van Rossum [Tue, 16 Jul 2002 14:30:28 +0000 (14:30 +0000)]
valid_identifier(): use an unsigned char* so that isalpha() will do
the right thing even if char is unsigned.

22 years agoAdd a blurb on the 3 Windows bugs I worked on over the last couple of days.
Mark Hammond [Tue, 16 Jul 2002 01:32:30 +0000 (01:32 +0000)]
Add a blurb on the 3 Windows bugs I worked on over the last couple of days.

22 years agoFix bug 581232 - [Windows] Can not interrupt time.sleep()
Mark Hammond [Tue, 16 Jul 2002 01:29:19 +0000 (01:29 +0000)]
Fix bug 581232 - [Windows] Can not interrupt time.sleep()

time.sleep() will now be interrupted on the main thread when Ctrl+C is pressed.  Other threads are never interrupted.

22 years agoAdded the "weird" ccTLDs ac, gg, im, and je. These are not recognized
Barry Warsaw [Mon, 15 Jul 2002 19:53:28 +0000 (19:53 +0000)]
Added the "weird" ccTLDs ac, gg, im, and je.  These are not recognized
by ISO 3166 as country codes, but the are reserved by IANA
nonetheless.  The commonly used uk ccTLD is part of this group, near
as I can tell.

22 years agoXXXROUNDUP(): Turns out this fixed Andrew MacIntyre's memory-mgmt
Tim Peters [Mon, 15 Jul 2002 17:58:03 +0000 (17:58 +0000)]
XXXROUNDUP():  Turns out this fixed Andrew MacIntyre's memory-mgmt
disaster too, so this change is here to stay.  Beefed up the comments
and added some stats Andrew reported.  Also a small change to the
macro body, to make it obvious how XXXROUNDUP(0) ends up returning 0.
See SF patch 578297 for context.

Not a bugfix candidate, as the functional changes here have already
been backported to the 2.2 line (this patch just improves clarity).

22 years agoAdded Andrew MacIntyre -- overdue!
Tim Peters [Mon, 15 Jul 2002 16:13:06 +0000 (16:13 +0000)]
Added Andrew MacIntyre -- overdue!

22 years ago/F revealed that ShellExecute() only requires shellapi.h, not the
Tim Peters [Mon, 15 Jul 2002 16:10:55 +0000 (16:10 +0000)]
/F revealed that ShellExecute() only requires shellapi.h, not the
full-blown windows.h, so changed accordingly.

22 years agoClarify that the description of sys.path[0] is only valid upon program
Guido van Rossum [Mon, 15 Jul 2002 16:08:10 +0000 (16:08 +0000)]
Clarify that the description of sys.path[0] is only valid upon program
start-up.

22 years agoTim_one's change to aggressively overallocate nodes when adding child
Andrew MacIntyre [Mon, 15 Jul 2002 12:03:19 +0000 (12:03 +0000)]
Tim_one's change to aggressively overallocate nodes when adding child
nodes (in Parser/node.c) resolves the gross memory consumption
exhibited by the EMX runtime on OS/2, so the test should be exercised
on this platform.

22 years agodocompare(): Another reasonable optimization from Jonathan Hogg for the
Tim Peters [Mon, 15 Jul 2002 05:16:13 +0000 (05:16 +0000)]
docompare():  Another reasonable optimization from Jonathan Hogg for the
explicit comparison function case:  use PyObject_Call instead of
PyEval_CallObject.  Same thing in context, but gives a 2.4% overall
speedup when sorting a list of ints via list.sort(__builtin__.cmp).

22 years agoFix bug 231273 - [windows] os.popen doens't kill subprocess when interrupted
Mark Hammond [Sun, 14 Jul 2002 23:28:16 +0000 (23:28 +0000)]
Fix bug 231273 - [windows] os.popen doens't kill subprocess when interrupted

Don't pass CREATE_NEW_CONSOLE to CreateProcess(), meaning our child process is in the same "console group" and therefore interrupted by the same Ctrl+C that interrupts the parent.

22 years agoFix bug 439992 - [win32] KeyboardInterrupt Not Caught.
Mark Hammond [Sun, 14 Jul 2002 23:12:29 +0000 (23:12 +0000)]
Fix bug 439992 - [win32] KeyboardInterrupt Not Caught.

This gets us closer to consistent Ctrl+C behaviour on NT and Win9x.  NT now reliably generates KeyboardInterrupt exceptions for NT when a file IO operation was aborted.  Bugfix candidate

22 years agoWINDOWS_LEAN_AND_MEAN: There is no such symbol, although a very few
Tim Peters [Sun, 14 Jul 2002 22:14:19 +0000 (22:14 +0000)]
WINDOWS_LEAN_AND_MEAN:  There is no such symbol, although a very few
MSDN sample programs use it, apparently in error.  The correct name
is WIN32_LEAN_AND_MEAN.  After switching to the correct name, in two
cases more was needed because the code actually relied on things that
disappear when WIN32_LEAN_AND_MEAN is defined.

22 years agoSF patch # 580411, move frame macros from frameobject.h into ceval.c
Neal Norwitz [Sun, 14 Jul 2002 00:27:26 +0000 (00:27 +0000)]
SF patch # 580411, move frame macros from frameobject.h into ceval.c
remove unused macros
use co alias instead of f->f_code in macros

22 years agoUndef MIN and MAX before defining them, to avoid warnings on certain
Guido van Rossum [Sat, 13 Jul 2002 14:31:51 +0000 (14:31 +0000)]
Undef MIN and MAX before defining them, to avoid warnings on certain
platforms.

22 years agoDon't declare a function with staticforward.
Jeremy Hylton [Sat, 13 Jul 2002 03:51:17 +0000 (03:51 +0000)]
Don't declare a function with staticforward.

Just declare it static so that lame (BAD_STATIC_FORWARD) compilers
don't see a mismatch between the prototype and the function.

22 years agoAdd more items
Andrew M. Kuchling [Fri, 12 Jul 2002 20:24:42 +0000 (20:24 +0000)]
Add more items
Use \cfunction instead of \function in various places
Add contributor names

22 years agoClarify the return value of __nonzero__(): It *must* be an integer.
Fred Drake [Fri, 12 Jul 2002 17:15:10 +0000 (17:15 +0000)]
Clarify the return value of __nonzero__(): It *must* be an integer.
Closes SF bug #579991.

22 years agofixed wrong classic MacOS pathname assumption
Just van Rossum [Fri, 12 Jul 2002 16:50:32 +0000 (16:50 +0000)]
fixed wrong classic MacOS pathname assumption

22 years agoRemove httplib from tested modules.
Jeremy Hylton [Fri, 12 Jul 2002 15:54:37 +0000 (15:54 +0000)]
Remove httplib from tested modules.

The test of httplib makes it difficult to maintain httplib.  There are
two many idioms that pyclbr doesn't seem to understand, and I don't
understand how to update these tests to make them work.

Also remove commented out test of urllib2.

22 years agoGet the meta class inheritance right.
Jeremy Hylton [Fri, 12 Jul 2002 15:42:10 +0000 (15:42 +0000)]
Get the meta class inheritance right.

22 years agoMention new encoding.
Marc-André Lemburg [Fri, 12 Jul 2002 14:40:04 +0000 (14:40 +0000)]
Mention new encoding.