Commit Graph

4249 Commits

Author SHA1 Message Date
Martin v. Löwis 0347a9a491 Get DBL_MAX from float.h not values.h. Will backport. 2006-10-27 07:06:52 +00:00
Martin v. Löwis 443ccc73f3 Check for values.h. Will backport. 2006-10-27 06:42:27 +00:00
Martin v. Löwis b5bc537c5e Patch #1549049: Rewrite type conversion in structmember.
Fixes #1545696 and #1566140. Will backport to 2.5.
2006-10-27 06:16:31 +00:00
Martin v. Löwis 1b2f627f96 - Patch #1560695: Add .note.GNU-stack to ctypes' sysv.S so that
ctypes isn't considered as requiring executable stacks.
Will backport to 2.5.
2006-10-22 10:55:15 +00:00
Ronald Oussoren 10168f25ad Patch #1580674: with this patch os.readlink uses the filesystem encoding to
decode unicode objects and returns an unicode object when the argument is one.
2006-10-22 10:45:18 +00:00
Martin v. Löwis a811c38d8e Fix various minor errors in passing arguments to
PyArg_ParseTuple.
2006-10-19 11:00:37 +00:00
Tim Peters 79665b1403 newIobject(): repaired incorrect cast to quiet MSVC warning. 2006-10-18 05:06:06 +00:00
Thomas Heller d2ea4a2584 ctypes callback functions only support 'fundamental' result types.
Check this and raise an error when something else is used - before
this change ctypes would hang or crash when such a callback was
called.  This is a partial fix for #1574584.

Will backport to release25-maint.
2006-10-17 19:30:48 +00:00
Martin v. Löwis 012bc7253b Bug #1567666: Emulate GetFileAttributesExA for Win95.
Will backport to 2.5.
2006-10-15 09:43:39 +00:00
Martin v. Löwis 18aaa568fd Patch #1576166: Support os.utime for directories on Windows NT+. 2006-10-15 08:43:33 +00:00
Georg Brandl 5597e261b2 Bug #1548891: The cStringIO.StringIO() constructor now encodes unicode
arguments with the system default encoding just like the write()
method does, instead of converting it to a raw buffer.
2006-10-12 09:47:12 +00:00
Martin v. Löwis f43893a878 Bug #1565150: Fix subsecond processing for os.utime on Windows. 2006-10-09 20:44:25 +00:00
Barry Warsaw e5ec613c4b List gc.get_count() in the module docstring. 2006-10-09 19:43:24 +00:00
Hye-Shik Chang b788346573 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:48:34 +00:00
Andrew M. Kuchling 36126c424a Cause a PyObject_Malloc() failure to trigger a MemoryError, and then
add 'if (PyErr_Occurred())' checks to various places so that NULL is
returned properly.

2.4 backport candidate.
2006-10-04 13:42:43 +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
Armin Rigo 0d2f498a4c Compilation problem caused by conflicting typedefs for uint32_t
(unsigned long vs. unsigned int).
2006-10-04 10:23:57 +00:00
Georg Brandl 4ddfcd3b60 Bug #1556784: allow format strings longer than 127 characters in
datetime's strftime function.
2006-09-30 11:17:34 +00:00
Neal Norwitz d3f91908dd Remove extra semi-colons reported by Johnny Lee on python-dev. Backport if anyone cares. 2006-09-23 04:11:38 +00:00
Jack Diederich 36234e8f66 * regression bug, count_next was coercing a Py_ssize_t to an unsigned Py_size_t
which breaks negative counts
* added test for negative numbers
will backport to 2.5.1
2006-09-21 17:50:26 +00:00
Gregory P. Smith 2fa067982c Fixes a bug with bsddb.DB.stat where the flags and txn keyword
arguments are transposed.  (reported by Louis Zechtzer)
..already committed to release24-maint
..needs committing to release25-maint
2006-09-19 17:35:04 +00:00
Martin v. Löwis 43fd99c8f8 Patch #1557515: Add RLIMIT_SBSIZE. 2006-09-16 17:36:37 +00:00
Andrew M. Kuchling e2782bb379 Rewrite help message to remove some of the parentheticals. (There were a lot of them.) 2006-09-14 11:28:50 +00:00
Andrew M. Kuchling 8964688274 Make --help mention that -v can be supplied multiple times 2006-09-14 11:22:18 +00:00
Thomas Heller 2244af596a The cast function did not accept c_char_p or c_wchar_p instances
as first argument, and failed with a 'bad argument to internal function'
error message.
2006-09-07 19:09:54 +00:00
Thomas Heller fdb62f0e5f Anonymous structure fields that have a bit-width specified did not work,
and they gave a strange error message from PyArg_ParseTuple:
    function takes exactly 2 arguments (3 given).

With tests.
2006-09-07 18:56:28 +00:00
Andrew M. Kuchling 62e475b84f [Bug #1552726] Avoid repeatedly polling in interactive mode -- only put a timeout on the select()
if an input hook has been defined.  Patch by Richard Boulton.

This select() code is only executed with readline 2.1, or if
READLINE_CALLBACKS is defined.

Backport candidate for 2.5, 2.4, probably earlier versions too.
2006-09-07 13:59:38 +00:00
Georg Brandl 74bb783c2f Bug #1551427: fix a wrong NULL pointer check in the win32 version
of os.urandom().
2006-09-06 06:03:59 +00:00
Hye-Shik Chang 199f1db1fa Fix a few bugs on cjkcodecs found by Oren Tirosh:
- 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 2013:2
  codepoints now.
2006-09-05 12:07:09 +00:00
Neal Norwitz 69e8897505 Bug #1550714: fix SystemError from itertools.tee on negative value for n.
Needs backport to 2.5.1 and earlier.
2006-09-02 02:58:13 +00:00
Neal Norwitz 6aefa916a9 Bug #1548092: fix curses.tparm seg fault on invalid input. Needs backport to 2.5.1 and earlier. 2006-09-02 02:50:35 +00:00
Thomas Heller b1a7d758e2 Add missing file for _ctypes.pyd port to win64 on AMD64. 2006-08-25 07:34:51 +00:00
Thomas Heller 98619f267c Port _ctypes.pyd to win64 on AMD64. 2006-08-25 07:27:33 +00:00
Thomas Wouters 9e398cac94 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:40:20 +00:00
Jeremy Hylton 60e96f666c Expose column offset information in parse trees. 2006-08-22 20:46:00 +00:00
Neal Norwitz 670f875a7c Alexander Belopolsky pointed out that pos is a size_t 2006-08-22 13:56:56 +00:00
Neal Norwitz 076d1e0c0b Fix a couple of ssize-t issues reported by Alexander Belopolsky on python-dev 2006-08-21 18:20:10 +00:00
Neal Norwitz 9b17eba8be Move assert to after NULL check, otherwise we deref NULL in the assert.
Klocwork #307
2006-08-19 04:23:04 +00:00
Thomas Heller 0b21b43d49 Add asserts to check for 'impossible' NULL values, with comments.
In one place where I'n not 1000% sure about the non-NULL, raise
a RuntimeError for safety.

This should fix the klocwork issues that Neal sent me.  If so,
it should be applied to the release25-maint branch also.
2006-08-18 14:38:46 +00:00
Fredrik Lundh dc075b9ddd SF#1534630
ignore data that arrives before the opening start tag
2006-08-16 16:47:07 +00:00
Thomas Heller b4a0cf17c4 Remove the special casing of Py_None when converting the return value
of the Python part of a callback function to C.  If it cannot be
converted, call PyErr_WriteUnraisable with the exception we got.
Before, arbitrary data has been passed to the calling C code in this
case.

(I'm not really sure the NEWS entry is understandable, but I cannot
find better words)
2006-08-16 15:10:12 +00:00
Thomas Heller b0aa98fd4f The __repr__ method of a NULL py_object does no longer raise an
exception.  Remove a stray '?' character from the exception text
when the value is retrieved of such an object.

Includes tests.
2006-08-16 14:07:44 +00:00
Thomas Heller d32e616722 Add commented assert statements to check that the result of
PyObject_stgdict() and PyType_stgdict() calls are non-NULL before
dereferencing the result.  Hopefully this fixes what klocwork is
complaining about.

Fix a few other nits as well.
2006-08-16 13:03:11 +00:00
Thomas Heller 4dc5dd1f3b Check for NULL return value from new_CArgObject calls. 2006-08-15 13:07:21 +00:00
Georg Brandl 9dc7b7ce82 Patch #1511317: don't crash on invalid hostname info 2006-08-14 22:10:24 +00:00
Georg Brandl 3335a7ad63 Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
2006-08-14 21:42:55 +00:00
Thomas Heller ef8d513d62 Patch #1536908: Add support for AMD64 / OpenBSD.
Remove the -no-stack-protector compiler flag for OpenBSD
as it has been reported to be unneeded.
2006-08-14 16:17:41 +00:00
Thomas Heller 867200483b Apply the patch #1532975 plus ideas from the patch #1533481.
ctypes instances no longer have the internal and undocumented
'_as_parameter_' attribute which was used to adapt them to foreign
function calls; this mechanism is replaced by a function pointer in
the type's stgdict.

In the 'from_param' class methods, try the _as_parameter_ attribute if
other conversions are not possible.

This makes the documented _as_parameter_ mechanism work as intended.

Change the ctypes version number to 1.0.1.
2006-08-14 11:17:48 +00:00
Thomas Heller e6dd31c50b Revert the change that tries to zero out a closure's result storage
area because the size if unknown in source/callproc.c.
2006-08-14 10:02:24 +00:00
Thomas Heller dca703fbda Check for NULL return value of GenericCData_new().
Fixes klockwork issues #188, #189.
2006-08-14 07:50:14 +00:00