Commit Graph

2457 Commits

Author SHA1 Message Date
Martin v. Löwis
5877bc3dfd Add recursion limit to pickling. Fixes #576084. 2002-09-22 08:21:45 +00:00
Neal Norwitz
163262e336 SF # 602108 ensure string is null terminated after strncpy 2002-09-13 14:40:50 +00:00
Neal Norwitz
df4626fb8a Backport of SF bug # 585792, Invalid mmap crashes Python interpreter
Raise ValueError if user passes a size to mmap which is larger
than the file.

Also need Tim's fix in test_mmap.py, 1.22 which flushes the file
before mmap'ing it.
2002-09-05 22:30:03 +00:00
Michael W. Hudson
c548fbf940 backport gvanrossum's checkin of
revision 2.234 of posixmodule.c

SF bug 563750 (Alex Martelli): posix_tmpfile():

The file returned by tmpfile() has mode w+b, so use that in the call
to PyFile_FromFile().

Bugfix candidate.
2002-08-23 16:27:40 +00:00
Tim Peters
506d6d91b4 SF bug 595919: popenN return only text mode pipes
popen2() and popen3() created text-mode pipes even when binary mode
was asked for.  This was specific to Windows.
2002-08-19 00:43:06 +00:00
Barry Warsaw
0c25da5823 Backport of fix for SF bug #595671 from Python 2.3cvs:
base64.decodestring('') should return '' instead of raising an
    exception.  The bug fix for SF #430849 wasn't quite right.  This
    closes SF bug #595671.  I'll backport this to Python 2.2.

One addition here is that there was no test of the base64 module in
Python 2.2 cvs yet, so I added that too.
2002-08-15 22:18:11 +00:00
Neal Norwitz
3aac4d25a2 SF bug #592645 fix memory leak in socket.getaddrinfo 2002-08-09 03:38:07 +00:00
Fred Drake
1459fc1201 The errno module needs to be statically linked, since it is now needed during
the extension building phase.
2002-08-08 19:52:42 +00:00
Martin v. Löwis
af1d308305 Add trace_frame. Fixes #534864. 2002-08-04 08:26:49 +00:00
Fred Drake
0123d97a71 Fix ref(), proxy() docstrings, based on comments from David Abrahams. 2002-08-02 20:17:14 +00:00
Michael W. Hudson
227c7696e4 Put Cray fixes on the branch, too. 2002-07-31 11:19:49 +00:00
Neal Norwitz
1320123908 Fix docstring to be consistent with parameter name (prefix) 2002-07-30 01:18:38 +00:00
Martin v. Löwis
1cbac94be1 Pass length of result structure into setipaddr. Fixes bug #565747. 2002-07-28 16:11:25 +00:00
Jeremy Hylton
634abb8607 Given the persistent id code a shot at a class before calling save_global().
Backported from the trunk.
2002-07-16 20:02:15 +00:00
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