Commit Graph

4325 Commits

Author SHA1 Message Date
Neal Norwitz 59f58aaeed Clear data so random memory does not get freed. Will backport. 2007-05-19 03:48:47 +00:00
Walter Dörwald 3ebc45d602 Backport checkin:
Fix a segfault when b"" was passed to b2a_qp() -- it was using strchr()
instead of memchr().
2007-05-09 18:10:47 +00:00
Thomas Heller 1ad576c267 Do not truncate 64-bit pointers to 32-bit integers.
Fixes SF #1703286, will backport to release25-maint.
2007-05-04 19:54:22 +00:00
Thomas Heller db3bfdf141 On 64-bit Windows, ffi_arg must be 8 bytes long. This fixes the
remaining crashes in the ctypes tests, when functions return float or
double types.
2007-05-04 08:20:41 +00:00
Kristján Valur Jónsson f030394de3 Fix problems in x64 build that were discovered by the testsuite:
- Reenable modules on x64 that had been disabled aeons ago for Itanium.
- Cleared up confusion about compilers for 64 bit windows.  There is only Itanium and x64.  Added macros MS_WINI64 and MS_WINX64 for those rare cases where it matters, such as the disabling of modules above.
- Set target platform (_WIN32_WINNT and WINVER) to 0x0501 (XP) for x64, and 0x0400 (NT 4.0) otherwise, which are the targeted minimum platforms.
- Fixed thread_nt.h.  The emulated InterlockedCompareExchange function didn´t work on x64, probaby due to the lack of a "volatile" specifier.  Anyway, win95 is no longer a target platform.
- Itertools module used wrong constant to check for overflow in count()
- PyInt_AsSsize_t couldn't deal with attribute error when accessing the __long__ member.
- PyLong_FromSsize_t() incorrectly specified that the operand were unsigned.

With these changes, the x64 passes the testsuite, for those modules present.
2007-05-03 20:27:03 +00:00
Thomas Heller 9b73d0aed5 Don't truncate pointers to integers (on win64 platform). 2007-05-03 12:05:20 +00:00
Neal Norwitz d83eb316dc Stop using PyMem_FREE while the GIL is not held. For details see:
http://mail.python.org/pipermail/python-dev/2007-May/072896.html
2007-05-02 04:47:55 +00:00
Thomas Heller 68bb9a1418 When accessing the .value attribute of a c_wchar_p instance, and the
instance does not point to a valid wchar_t zero-terminated string,
raise a ValueError.  c_char_p does this already.

The ValueError message now contains the correct pointer address.

Will backport to release25-maint.
2007-04-30 16:04:57 +00:00
Thomas Heller 5a901bd3cc Make sure to call PyErr_NoMemory() in several places where
PyMem_Malloc() could potentially fail.

Will backport to the release25-maint branch.
2007-04-30 15:44:17 +00:00
Kristján Valur Jónsson 7a0da19087 Complete revamp of PCBuild8 directory. Use subdirectories for each project under the main pcbuild solution. Now make extensive use of property sheets to simplify project configuration. x64 build fully supported, and the process for building PGO version (Profiler Guided Optimization) simplified. All projects are now present, except _ssl, which needs to be reimplemented. Also, some of the projects that require external libraries need extra work to fully compile on x64. 2007-04-30 15:17:46 +00:00
Kristján Valur Jónsson bd77c037ed Accomodate 64 bit time_t in the _bsddb module. 2007-04-26 15:24:54 +00:00
Kristján Valur Jónsson 0a440d4184 Export function sanitize_the_mode from fileobject.c as _PyFile_SanitizeMode(). Use this function in posixmodule.c when implementing fdopen(). This fixes test_subprocess.py for a VisualStudio 2005 compile. 2007-04-26 09:15:08 +00:00
Kristján Valur Jónsson 67387fb4aa Make pythoncore compile cleanly with VisualStudio 2005. Used an explicit typecast to get a 64 bit integer, and undefined the Yield macro that conflicts with winbase.h 2007-04-25 00:17:39 +00:00
Kristján Valur Jónsson 17b8e97e2e Merge change 54909 from release25-maint: Fix several minor issues discovered using code analysis in VisualStudio 2005 Team Edition 2007-04-25 00:10:50 +00:00
Neal Norwitz bd53870d89 SF #1703270, add missing declaration in readline.c to avoid compiler warning. 2007-04-19 05:52:37 +00:00
Andrew M. Kuchling a6fbc1eabb Point readers at the patch submission instructions 2007-04-11 13:42:25 +00:00
Andrew M. Kuchling 400a49ba79 Add window.chgat() method, submitted via e-mail by Fabian Kreutz 2007-04-11 13:39:00 +00:00
Raymond Hettinger 7a3d41f4ca Bug #1563759: struct.unpack doens't support buffer protocol objects 2007-04-05 18:00:03 +00:00
Martin v. Löwis 3bf573f918 Bug #1686475: Support stat'ing open files on Windows again.
Will backport to 2.5.
2007-04-04 18:30:36 +00:00
Matthias Klose e19e0c21ae - Fix an off-by-one bug in locale.strxfrm().
patch taken from http://bugs.debian.org/416934.
2007-04-03 04:35:59 +00:00
Raymond Hettinger 01a807db2a Array module's buffer interface can now handle empty arrays. 2007-04-02 22:54:21 +00:00
Raymond Hettinger e6e660bde3 SF #1693079: Cannot save empty array in shelve 2007-04-02 17:29:30 +00:00
Neal Norwitz ea3307bf3f Fix method names. Will backport. 2007-03-31 18:54:18 +00:00
Georg Brandl 30712ab82f In Windows' time.clock(), when QueryPerformanceFrequency() fails,
the C lib's clock() is used, but it must be divided by CLOCKS_PER_SEC
as for the POSIX implementation (thanks to #pypy).
2007-03-29 12:42:07 +00:00
Facundo Batista 1fe9f968a2 Bug 1688393. Adds a control of negative values in
socket.recvfrom, which caused an ugly crash.
2007-03-28 03:45:20 +00:00
Thomas Heller e6a7039451 Prevent creation (followed by a segfault) of array types when the size
overflows the valid Py_ssize_t range.  Check return values of
PyMem_Malloc.

Will backport to release25-maint.
2007-03-23 19:55:27 +00:00
Thomas Heller 82730f8d11 Explain the purpose of the b_needsfree flag (forward ported from release25-maint). 2007-03-22 20:34:37 +00:00
Thomas Heller f493cbd824 Back out "Patch #1643874: memory leak in ctypes fixed."
The code in this patch leaves no way to give up the ownership of a
BSTR instance.
2007-03-22 19:44:31 +00:00
Georg Brandl 4aef7275cb Patch #1185447: binascii.b2a_qp() now correctly quotes binary characters
with ASCII value less than 32. Also, it correctly quotes dots only if
they occur on a single line, as opposed to the previous behavior of
quoting dots if they are the second character of any line.
2007-03-13 22:49:43 +00:00
Thomas Heller 5dc4fe09b7 Patch #1649190: Adding support for _Bool to ctypes as c_bool, by David Remahl. 2007-03-13 20:42:52 +00:00
Georg Brandl a47337fba5 Bug #1622896: fix a rare corner case where the bz2 module raised an
error in spite of a succesful compression.
2007-03-13 12:34:25 +00:00
Georg Brandl 7478096148 Typos. 2007-03-10 07:38:14 +00:00
Thomas Heller 2456a3c02a Bug #1651235: When a tuple was passed to a ctypes function call,
Python would crash instead of raising an error.

The crash was caused by a section of code that should have been
removed long ago, at that time ctypes had other ways to pass
parameters to function calls.
2007-03-09 20:39:22 +00:00
Thomas Heller c2f7725c86 Fix bug #1646630: ctypes.string_at(buf, 0) and ctypes.wstring_at(buf, 0)
returned string up to the first NUL character.
2007-03-09 19:21:28 +00:00
Georg Brandl 49aafc9f2c Variant of patch #697613: don't exit the interpreter on a SystemExit
exception if the -i command line option or PYTHONINSPECT environment
variable is given, but break into the interactive interpreter just like
on other exceptions or normal program exit.
 (backport)
2007-03-07 00:34:46 +00:00
Walter Dörwald d391f0855c Patch for bug #1633621: if curses.resizeterm() or
curses.resize_term() is called, update _curses.LINES,
_curses.COLS, curses.LINES and curses.COLS.
2007-03-06 20:38:57 +00:00
Georg Brandl 40c626159d Patch #1654417: make operator.{get,set,del}slice use the full range
of Py_ssize_t.
2007-03-06 18:59:11 +00:00
Guido van Rossum 2054ee9b6f Patch #1646728: datetime.fromtimestamp fails with negative
fractional times.  With unittest.

Somebody please backport to 2.5.
2007-03-06 15:50:01 +00:00
Georg Brandl b51a57eb32 Fix another reincarnation of bug #1576657 in defaultdict. 2007-03-06 13:32:52 +00:00
Raymond Hettinger eb9798892d Prepare collections module for pure python code entries. 2007-02-28 18:37:52 +00:00
Raymond Hettinger 1b6ca54c44 Remove filler struct item and fix leak. 2007-02-21 17:22:05 +00:00
Raymond Hettinger d36862cf78 Add itertools.izip_longest(). 2007-02-21 05:20:38 +00:00
Martin v. Löwis 382abeff0f Patch #1490190: posixmodule now includes os.chflags() and os.lchflags()
functions on platforms where the underlying system calls are available.
2007-02-19 10:55:19 +00:00
Martin v. Löwis f228482735 Update 1432399 to removal of _BT_SOCKADDR_MEMB. 2007-02-14 11:30:07 +00:00
Martin v. Löwis 45423a7571 Patch #1432399: Add HCI sockets. 2007-02-14 10:07:37 +00:00
Martin v. Löwis b1cc1d407b Patch #1657276: Make NETLINK_DNRTMSG conditional.
Will backport.
2007-02-13 12:14:19 +00:00
Martin v. Löwis 4c11a92625 Bug #1653736: Complain about keyword arguments to time.isoformat.
Will backport to 2.5.
2007-02-08 09:13:36 +00:00
Raymond Hettinger 6d121f168c Do not let overflows in enumerate() and count() pass silently. 2007-02-08 00:07:32 +00:00
Raymond Hettinger 5a0217efea Check for a common user error with defaultdict(). 2007-02-07 21:42:17 +00:00
Georg Brandl 7a28447d4c Bug #1645944: os.access now returns bool but docstring is not updated 2007-01-27 19:38:50 +00:00