Commit Graph

2443 Commits

Author SHA1 Message Date
Fred Drake
996425f366 Update the comments on building the pyexpat extension.
Closes SF bug #577774.
2002-07-10 19:01:25 +00:00
Tim Peters
9d8c8ff9ae Backport for SF bug #574132: Major GC related performance regression.
2.2.1 has another bug that prevents the regression (which isn't a
regression at all) from showing up.  "The regression" is actually a
glitch in cyclic gc that's been there forever.

As the generation being collected is analyzed, objects that can't be
collected (because, e.g., we find they're externally referenced, or
are in an unreachable cycle but have a __del__ method) are moved out
of the list of candidates.  A tricksy scheme uses negative values of
gc_refs to mark such objects as being moved.  However, the exact
negative value set at the start may become "more negative" over time
for objects not in the generation being collected, and the scheme was
checking for an exact match on the negative value originally assigned.
As a result, objects in generations older than the one being collected
could get scanned too, and yanked back into a younger generation.  Doing
so doesn't lead to an error, but doesn't do any good, and can burn an
unbounded amount of time doing useless work.

A test case is simple (thanks to Kevin Jacobs for finding it!):

x = []
for i in xrange(200000):
    x.append((1,))

Without the patch, this ends up scanning all of x on every gen0 collection,
scans all of x twice on every gen1 collection, and x gets yanked back into
gen1 on every gen0 collection.  With the patch, once x gets to gen2, it's
never scanned again until another gen2 collection, and stays in gen2.

Opened another bug about that 2.2.1 isn't actually tracking (at least)
iterators, generators, and bound method objects, due to using the 2.1
gc API internally in those places (which #defines itself out of existence
in 2.2.x).
2002-06-30 18:48:53 +00:00
Guido van Rossum
277316f694 Corect speling and add \n\ to line ends in new docstring for access(). 2002-06-18 16:24:15 +00:00
Fred Drake
0a04f7e656 Clarified documentation for os.access().
Based on patch contributed by Sean Reifschneider.
Closes SF patch #570618.
2002-06-18 16:16:46 +00:00
Neal Norwitz
046b35cf44 SF # 533070 Silence AIX C Compiler Warnings
Warning caused by using &func.  & is not necessary.
2002-06-13 21:39:47 +00:00
Guido van Rossum
4130d6c23a Oops. That wasn't supposed to be backported. :-( 2002-06-06 20:11:15 +00:00
Guido van Rossum
93f2edba15 Backport:
The tp_new implementation should initialize the errorhandler field,
otherwise this code could segfault:

  from socket import socket
  s = socket.__new__(socket)
  s.recv(100)
2002-06-06 20:10:16 +00:00
Neil Schemenauer
87d631630d The logreader object did not always refill the input buffer correctly
and got confused by certain log files.  Remove logreader_refill and the
associated logic and replace with fgetc.
2002-05-29 18:44:30 +00:00
Anthony Baxter
07fb92a86f backport tim_one's patch:
(some tweaking for different _PyObject_GC_Malloc() call in 2.2. checked,
still returns the same thing on failure...)

_PyObject_GC_New:  Could call PyObject_INIT with a NULL 1st argument.
_PyObject_GC_NewVar:  Could call PyObject_INIT_VAR likewise.

Bugfix candidate.

Original patch(es):
python/dist/src/Modules/gcmodule.c:2.40
2002-04-30 03:33:15 +00:00
Martin v. Löwis
b390f5f73b Patch #500311: Work around for buggy https servers. Fixes #494762. 2002-04-20 07:45:25 +00:00
Martin v. Löwis
9b6e538d7f Patch #546194: Check constants individually. Fixes 534143 on OpenBSD. 2002-04-19 21:06:13 +00:00
Jeremy Hylton
5ea334ed7a [backport bug fix from the trunk]
Fix SF #544995 (zlib crash on second flush call)
Bug fix by mhammond.

Bug fix candidate for 2.2, not present in 2.1.
2002-04-19 14:59:08 +00:00
Michael W. Hudson
044038af4b backport loewis' checkin of
revision 2.28 of _localemodule.c

Don't imply XPG4 constants from CODESET presence. Fixes #534153.
2.2.2 candiate.
2002-04-05 15:26:55 +00:00
Guido van Rossum
50bfe35112 The body of_PyObject_GC_UnTrack() should only be compiled #ifdef
WITH_CYCLE_GC.  (Neil pointed this out before the weekend, and I fixed
it right away, but forgot to check it in.)
2002-04-03 14:07:32 +00:00
Guido van Rossum
9ff1cf05fb Backport to 2.2.1:
This is Neil's fix for SF bug 535905 (Evil Trashcan and GC interaction).

The fix makes it possible to call PyObject_GC_UnTrack() more than once
on the same object, and then move the PyObject_GC_UnTrack() call to
*before* the trashcan code is invoked.

BUGFIX CANDIDATE!
2002-03-28 20:36:50 +00:00
Michael W. Hudson
6403be2c00 backport jackjansen's checkin of
revision 1.211 of socketmodule.c

Due to interaction between the MSL C library and the GUSI I/O library I can get reads from sockets to work consistently either for unbuffered binary files or for buffered binary files, but not for both:-(

The workaround is to force socket.makefile() to disable buffering for binary files.

Fixes bug 534625. 2.2.1 candidate.
2002-03-25 17:40:43 +00:00
Michael W. Hudson
39d2b3c330 Remove extraneous #define as per effbot's instructions in:
[ 530285 ] redefining SRE_CODE in Modules/sre.h

Another one for the trunk, later.
2002-03-18 12:59:38 +00:00
Michael W. Hudson
9bf2889930 Backport a checkin of lemburg's:
Remove mentioning of -U option in "python -h" output.
2002-03-17 19:42:18 +00:00
Michael W. Hudson
32b2b2d99d Backport my fix from a whiles back:
Fix for

[ #504284 ] Last build problems on AIX

I'm ignoring the suggestion that this should be an autoconf test in the
interests of having a fix today.  Feel free to quibble.
2002-03-17 19:02:10 +00:00
Michael W. Hudson
023db775f7 backport loewis' checkin of
revision 2.23 of pypcre.c

Include Python.h first. Fixes #530159.
2002-03-16 17:58:21 +00:00
Michael W. Hudson
3df46a8028 backport loewis' checkin of
revision 2.26 of _localemodule.c

Verify arguments for nl_langinfo. Fixes #528879.
2002-03-16 17:54:20 +00:00
Fred Drake
14f675884a Update docstrings to use te attribute names of the new structures returned
by stat and time functions.
This closes SF patch #523271.
2002-03-12 21:38:31 +00:00
Michael W. Hudson
b5c204249f backport tim_one's checkin of
revision 2.28 of cmathmodule.c

SF bug 525705:  [2.2] underflow raise OverflowException.
Another year in the quest to out-guess random C behavior.

Added macros Py_ADJUST_ERANGE1(X) and Py_ADJUST_ERANGE2(X, Y).  The latter
is useful for functions with complex results.  Two corrections to errno-
after-libm-call are attempted:

1. If the platform set errno to ERANGE due to underflow, clear errno.
   Some unknown subset of libm versions and link options do this.  It's
   allowed by C89, but I never figured anyone would do it.

2. If the platform did not set errno but overflow occurred, force
   errno to ERANGE.  C89 required setting errno to ERANGE, but C99
   doesn't.  Some unknown subset of libm versions and link options do
   it the C99 way now.

Bugfix candidate, but hold off until some Linux people actually try it,
with and without -lieee.  I'll send a help plea to Python-Dev.
2002-03-11 10:16:47 +00:00
Michael W. Hudson
8cdebb2e60 backport jhylton's checkin of
revision 2.33 of cStringIO.c

Fix SF bug #526518

The doc string for cStringIO suggested that str() of a StringIO object
was equivalent to getvalue().  This was never true, so repair the doc
string.  (doctest would have helped here.)

Bug fix candidate for any past versions.
2002-03-11 10:02:18 +00:00
Michael W. Hudson
85717c768a backport tim_one's checkin of
revision 2.38 of mmapmodule.c

SF bug 515943:  searching for data with \0 in mmap.
mmap_find_method():  this obtained the string to find via s#, but it
ignored its length, acting as if it were \0-terminated instead.

Someone please run on Linux too (the extended test_mmap works on Windows).

Bugfix candidate.
2002-03-08 13:40:07 +00:00