Mark Dickinson
efc82f7e8e
Issue #4258 : Use 30-bit digits for Python longs, on 64-bit platforms.
...
Backport of r70459.
2009-03-20 15:51:55 +00:00
Nick Coghlan
8eba5ed0d9
Make marshalling errors a little more informative as to what went wrong
2009-03-15 03:24:46 +00:00
Raymond Hettinger
305480c9dc
Issue 3116: fix quadratic behavior in marshal.dumps().
2008-06-16 01:42:40 +00:00
Gregory P. Smith
dd96db63f6
This reverts r63675 based on the discussion in this thread:
...
http://mail.python.org/pipermail/python-dev/2008-June/079988.html
Python 2.6 should stick with PyString_* in its codebase. The PyBytes_* names
in the spirit of 3.0 are available via a #define only. See the email thread.
2008-06-09 04:58:54 +00:00
Christian Heimes
593daf545b
Renamed PyString to PyBytes
2008-05-26 12:51:38 +00:00
Andrew M. Kuchling
6c02916dfb
#1792 : Improve performance of marshal.dumps() on large objects by increasing
...
the size of the buffer more quickly.
2008-05-11 13:33:56 +00:00
Neal Norwitz
fb43d1e4aa
Fix refleak
2008-02-01 07:22:59 +00:00
Christian Heimes
67ac0667f0
Removed unused var
2008-01-30 11:46:00 +00:00
Raymond Hettinger
bf3d1d5dc8
Removed unnecessary conditional (spotted by Neal Norwitz).
2008-01-28 21:51:25 +00:00
Raymond Hettinger
52716c94be
Let marshal built-up sets and frozensets one element at a time (without creating an intermediate tuple).
2008-01-28 21:34:30 +00:00
Raymond Hettinger
dee3f65d98
Revert PySet_Add() changes.
2008-01-26 09:31:11 +00:00
Raymond Hettinger
b423f02aa5
Let marshal build-up sets and frozensets one element at a time.
...
Saves the unnecessary creation of a tuple as intermediate container.
2008-01-26 08:37:28 +00:00
Raymond Hettinger
12e94200c0
Fix marshal's incorrect handling of subclasses of builtin types (backport candidate).
2007-11-07 01:13:09 +00:00
Neal Norwitz
15f2661758
Fix Coverity 185-186: If the passed in FILE is NULL, uninitialized memory
...
would be accessed.
Will backport.
2007-10-12 03:05:19 +00:00
Neal Norwitz
f6b0e4dca8
Last try for tweaking the max stack depth. 5000 was the original value,
...
4000 didn't work either. 1000 does work on Windows. If 2000 works,
that will hopefully be a reasonable balance.
2007-05-17 07:04:46 +00:00
Neal Norwitz
4f82bc3183
Set the depth to something very small to try to determine if the
...
crashes on Windows are really due to the stack size or possibly
some other problem.
2007-05-17 06:23:50 +00:00
Neal Norwitz
117ef0863b
Reduce the max stack depth to see if this fixes the segfaults on
...
Windows and some other boxes. If this is successful, this rev should
be backported. I'm not sure how close to the limit we should push this.
2007-05-17 06:11:36 +00:00
Neal Norwitz
b1a9b37aa8
Fix bug in marshal where bad data would cause a segfault due to
...
lack of an infinite recursion check.
Contributed by Damien Miller at Google.
2007-05-16 20:05:11 +00:00
Armin Rigo
7ccbca93a2
Forward-port of r52136,52138: a review of overflow-detecting code.
...
* 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.
* 2.5 specific: fixed a number of places that were still confusing int
and Py_ssize_t. Some of them could potentially have caused
"real-world" breakage.
* list.pop(x): fixing overflow issues on x was messy. I just reverted
to PyArg_ParseTuple("n"), which does the right thing. (An obscure
test was trying to give a Decimal to list.pop()... doesn't make
sense any more IMHO)
* trying to write a few tests...
2006-10-04 12:17:45 +00:00
Neal Norwitz
edb2168079
This code is actually not used unless WITHOUT_COMPLEX is defined.
...
However, there was no error checking that PyFloat_FromDouble returned
a valid pointer. I believe this change is correct as it seemed
to follow other code in the area.
Klocwork # 292.
2006-08-12 01:47:59 +00:00
Georg Brandl
bf92f46572
Convert more modules to METH_VARARGS.
2006-05-29 21:58:42 +00:00
Martin v. Löwis
725507b52e
Change int to Py_ssize_t in several places.
...
Add (int) casts to silence compiler warnings.
Raise Python exceptions for overflows.
2006-03-07 12:08:51 +00:00
Thomas Wouters
695934a0ef
Make Py_ssize_t clean.
2006-03-01 23:49:13 +00:00
Thomas Wouters
7464b43e41
Fix incompatible assignment warning from previous checkin.
2006-03-01 22:34:09 +00:00
Thomas Wouters
7f401ef73d
Fix gcc (4.0.x) warning about use of uninitialized variables.
...
(PyMarshal_ReadShortFromFile() is only used in zipimport.c, I don't believe
the extra initializations will matter one way or another.)
2006-03-01 22:30:47 +00:00