2429 Commits

Author SHA1 Message Date
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
Michael W. Hudson
45e7de400a backport gvanrossum's checkin of
revision 2.40 of mpzmodule.c

SF patch 517245 by Marc Recht.

Support GMP version >= 2.

Bugfix candidate.
2002-03-05 14:20:32 +00:00
Fred Drake
68726f5384 start() and stop() methods: return None where there is no exception;
returning NULL causes the interpreter to raise a SystemError.
Noted by Anthony Baxter at Python 10.
2002-02-08 21:31:23 +00:00
Michael W. Hudson
31df2c36ee Backport my fixing up of PyObject_New/PyMem_Del mismatches. 2002-02-06 17:11:51 +00:00
Michael W. Hudson
fa338d7fad Fix a bunch of typos found by nnorwitz. 2002-02-06 17:06:03 +00:00
Michael W. Hudson
fbfb20efae It's merge time!
Backport loewis' checkin of revision 1.123:

Encode Unicode arguments to split/splitlist as UTF-8. Fixes #507962.
2.2.1 bugfix candidate.
2002-01-28 15:14:57 +00:00
Michael W. Hudson
dd562b49fc It's merge time!
Backport gvanrossum's checkin of revision 2.38:

There's no need for typechecks on the second and third argument of
new.instancemethod() -- the instancemethod object is now a perfectly
general container.

This fixes SF bug ##503091 (Pedro Rodriquez): new.instancemethod fails
for new classes

This is a 2.2.1 candidate.
2002-01-28 15:03:36 +00:00
Martin v. Löwis
0d21e64409 Include <unistd.h> in Python.h. Fixes #500924. 2002-01-12 11:13:24 +00:00
Martin v. Löwis
d941bad617 Add fcntl.h constants from glibc 2.2.4. Fixes #496171. 2001-12-28 21:09:23 +00:00
Michael W. Hudson
342ff9913c Backport gvanrossum's checkin of version 2.217:
Due to a cut-and-paste error, the type object exported under the name
statvfs_result was in fact the stat_result type object. :-(

2.2.1 bugfix!
2001-12-28 10:24:44 +00:00
Michael W. Hudson
b8be8c67e6 Backport loewis' checkin of version 1.201:
Add TCP socket options from glibc 2.2.4. Fixes #495680.
2.2.1 bugfix candidate.
2001-12-28 10:12:44 +00:00
cvs2svn
22768184cb This commit was manufactured by cvs2svn to create branch
'release22-maint'.
2001-12-28 04:27:46 +00:00
Tim Peters
500bd035fa SF bug #495021: Crash calling os.stat with a trailing backslash
Patch from Mark Hammond, plus code rearrangement and comments from me.
posix_do_stat():  Windows-specific code could try to free() stack
memory in some cases when a path ending with a forward or backward slash
was passed to os.stat().
2001-12-19 19:05:01 +00:00
Guido van Rossum
950dce6f01 save(): Fix for SF bug #494904: Cannot pickle a class with a
metaclass, reported by Dan Parisien.

Objects that are instances of custom metaclasses, i.e. whose ob_type
is a subclass of PyType_Type, should be pickled the same as new-style
classes (objects whose ob_type is PyType_Type).  This can't be done
through the existing dispatch switches, and the __reduce__ trick
doesn't work for these, since it finds the unbound __reduce__ for
instances of the class (inherited from PyBaseObject_Type).  So check
explicitly using PyType_IsSubtype().
2001-12-19 16:56:54 +00:00
Tim Peters
1fbb577ee2 SF bug #494738: binascii_b2a_base64 overwrites memory.
binascii_b2a_base64():  We didn't allocate enough buffer space for very
short inputs (e.g., a 1-byte input can produce a 5-byte output, but we
only allocated 2 bytes).  I expect that malloc overheads absorbed the
overrun in practice, but computing a correct upper bound is a very simple
change.
2001-12-19 04:41:35 +00:00