3475 Commits

Author SHA1 Message Date
Tim Peters
2b37ea4087 Backport of the pieces of trunk rev 46589 relevant to
fixing an unlikely crash bug in dict resizing, SF
bug 1456209.

The rest of rev 46589 changes whether Python suppresses
exceptions during some dict-related comparisons.  While I
think that's a good idea, it does change visible behavior at
times, and there was already some complaining about that on
the trunk.  Not a good idea for backporting.  The part of
46589 checked in here can at worst stop segfaults, and I doubt
anyone will gripe about that ;-)
2006-10-09 20:24:45 +00:00
Martin v. Löwis
b8f82e6feb Backport r45505, r45573, r45576
- reset errno before calling confstr - use confstr() doc to simplify
  checks afterwards
- Correct implementation and documentation of os.confstr.  Add a simple
  test case.  I've yet to figure out how to provoke a None return I can test.
- Address issues brought up by MvL on python-checkins.
  I tested this with valgrind on amd64.

  The man pages I found for diff architectures are inconsistent on this.
  I'm not entirely sure this change is correct for all architectures
  either.

  Perhaps we should just over-allocate and not worry about it?

The change to return None instead of "" in case of unconfigured
values has not been backported.
2006-10-09 19:29:06 +00:00
Ronald Oussoren
392cafba4f Port of universal binary support for Mac OSX from python 2.5. This takes away
the need for the out-of-tree universal binary support that was used to build
the 2.4.3 installer.

Missing here relative to that tree are some changes to IDLE, IMHO those patches
aren't appropriate for the 2.4 branch and users are better of using 2.5's IDLE.
2006-10-08 17:41:25 +00:00
Hye-Shik Chang
2d09be9e48 Backport from trunk r52223:
Bug #1572832: fix a bug in ISO-2022 codecs which may cause segfault
when encoding non-BMP unicode characters.  (Submitted by Ray Chason)
2006-10-08 13:56:00 +00:00
Andrew M. Kuchling
1af9f68b4a [Backport r51248 | neal.norwitz]
Fix segfault when doing string formatting on subclasses of long if
__oct__, __hex__ don't return a string.

Klocwork 308
2006-10-05 17:18:13 +00:00
Armin Rigo
b2d0f34240 A review of overflow-detecting code in the 2.4 branch.
* unified the way intobject, longobject and mystrtoul handle
  values around -sys.maxint-1.

* in general, trying to entierely avoid overflows in any computation
  involving signed ints or longs is extremely involved.  Fixed a few
  simple cases where a compiler might be too clever (but that's all
  guesswork).

* more overflow checks against bad data in marshal.c.
2006-10-04 10:13:32 +00:00
Martin v. Löwis
98041d7bf0 Fix integer negation and absolute value to not rely
on undefined behaviour of the C compiler anymore.
2006-10-04 05:48:05 +00:00
Andrew M. Kuchling
9569ea3425 [Backport rev. 51728 by neal.norwitz]
Patch #1540470, for OpenBSD 4.0.  Backport candidate for 2.[34].
2006-10-03 13:08:57 +00:00
Georg Brandl
16e469b249 Bug #1556784: allow format strings longer than 127 characters in
datetime's strftime function.
 (backport from rev. 52072)
2006-09-30 11:17:39 +00:00
Georg Brandl
ee2940d5d2 Bug #1560617: in pyclbr, return full module name not only for classes,
but also for functions.
 (backport from rev. 52069)
2006-09-30 11:06:51 +00:00
Georg Brandl
adf8a1d0cb Patch #1567691: super() and new.instancemethod() now don't accept
keyword arguments any more (previously they accepted them, but didn't
use them).
 (backport from rev. 52058)
2006-09-30 08:43:35 +00:00
Andrew M. Kuchling
c138772a20 [Backport rev. 46882 by neal.norwitz]
Fix the socket tests so they can be run concurrently.  Backport candidate
2006-09-29 18:30:59 +00:00
Neal Norwitz
27d7e8dc64 Backport 51850 from release25-maint branch.
As mentioned on python-dev, reverting patch #1504333 because it introduced
an infinite loop in rev 47154.

This patch also adds a test to prevent the regression.
2006-09-11 04:18:06 +00:00
Hye-Shik Chang
56b5458f43 Backport from trunk r51737:
Fixed a few bugs on cjkcodecs:
- gbk and gb18030 codec now handle U+30FB KATAKANA MIDDLE DOT correctly.
- iso2022_jp_2 codec now encodes into G0 for KS X 1001, GB2312
 codepoints to conform the standard.
- iso2022_jp_3 and iso2022_jp_2004 codec can encode JIS X 0213:2
 codepoints now.
2006-09-07 13:06:10 +00:00
Thomas Wouters
ba8522ad28 Backport trunk's revision 51565:
Fix SF bug #1545837: array.array borks on deepcopy.
array.__deepcopy__() needs to take an argument, even if it doesn't actually
use it. Will backport to 2.5 and 2.4 (if applicable.)
2006-08-24 18:55:01 +00:00
Georg Brandl
79ba8e53aa Backport rev 51448:
- Patch #1541585: fix buffer overrun when performing repr() on
  a unicode string in a build with wide unicode (UCS-4) support.
2006-08-22 08:25:33 +00:00
Georg Brandl
ee76a565c3 Add an additional test: BZ2File write methods should raise IOError
when file is read-only.
 (backport from rev. 51287)
2006-08-14 21:45:35 +00:00
Georg Brandl
28930e418b Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
 (backport from rev. 51285)
2006-08-14 21:42:58 +00:00
Georg Brandl
1f2e503f71 Backport whitespace-normalization-proofing test_cgi fix. 2006-08-11 07:32:53 +00:00
Georg Brandl
8aab37ed1f Chris McDonough's patch to defend against certain DoS attacks on FieldStorage.
SF bug #1112549. (backport from rev. 51190)
2006-08-11 07:14:38 +00:00
Georg Brandl
b302323c65 Backport fixes for #1523610 (crashes in PyArg_ParseTuple):
rev. 51158 and rev. 50843.
2006-08-09 07:15:29 +00:00
Thomas Heller
f6f89e602c memcmp() can return values other than -1, 0, and +1 but tp_compare
must not.
2006-08-08 17:42:30 +00:00
Georg Brandl
cc09e42f55 Don't produce output in test_builtin.
(backport from rev. 51131)
2006-08-06 09:17:22 +00:00
Georg Brandl
4eb9634368 Bug #1535165: fixed a segfault in input() and raw_input() when
sys.stdin is closed.
 (backport from rev. 51129)
2006-08-06 08:23:59 +00:00
Georg Brandl
33b621c35d Bug #1535182: really test the xreadlines() method of bz2 objects.
(backport from rev. 51126)
2006-08-06 07:08:16 +00:00