Backport the .sln and .vcproj files for PCBuild8 from the python trunk to the 2.5 maintainance branch. This fixes build problems with visual studio 2005, and cleans up profile guided optimization.
[Backport to 2-5maint of r52147 | andrew.kuchling ; the buildbots seem OK
with this change.]
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.
Armin Rigo [Wed, 4 Oct 2006 11:44:06 +0000 (11:44 +0000)]
Forward-port of r52136: 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)
Georg Brandl [Sat, 30 Sep 2006 08:43:50 +0000 (08:43 +0000)]
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)
Georg Brandl [Mon, 25 Sep 2006 06:58:00 +0000 (06:58 +0000)]
Backport rev. 51971:
Fix %zd string formatting on Mac OS X so it prints negative numbers.
In addition to testing positive numbers, verify negative numbers work in configure.
In order to avoid compiler warnings on OS X 10.4, also change the order of the check
for the format character to use (PY_FORMAT_SIZE_T) in the sprintf format
for Py_ssize_t. This patch changes PY_FORMAT_SIZE_T from "" to "l" if it wasn't
defined at configure time. Need to verify the buildbot results.
Georg Brandl [Sun, 24 Sep 2006 12:50:28 +0000 (12:50 +0000)]
Fix a bug in traceback.format_exception_only() that led to an error
being raised when print_exc() was called without an exception set.
In version 2.4, this printed "None", restored that behavior.
(backport from rev. 51995)
Georg Brandl [Sun, 24 Sep 2006 12:35:40 +0000 (12:35 +0000)]
Fix a bug in the parser's future statement handling that led to "with"
not being recognized as a keyword after, e.g., this statement:
from __future__ import division, with_statement
(backport from rev. 51993)
Jack Diederich [Thu, 21 Sep 2006 18:32:11 +0000 (18:32 +0000)]
backport of r51950
* 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
Building with HP's cc on HP-UX turned up a couple of problems.
_PyGILState_NoteThreadState was declared as static inconsistently.
Make it static as it's not necessary outside of this module.
Some tests failed because errno was reset to 0. (I think the tests
that failed were at least: test_fcntl and test_mailbox).
Ensure that errno doesn't change after a call to Py_END_ALLOW_THREADS.
This only affected debug builds.
This needs to be ported to HEAD. I'll try to remember to do that tomorrow.
(Anyone, feel free to port it.)
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.
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).
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.
No, the problem was actually because buildbot uses a StringIO in
place of sys.stdout while running tests. Removing one more test
to make buildbot happy.
Fixed bug #1531862: Do not close standard file descriptors in subprocess.
Let's try that once more. Buildbots were broken last time, but probably
because tests were sending data to stderr for testing it (sending to a
file doesn't touch the problem).
The fix is still the same, but tests were reduced (removing tests to
be able to fix something is weird, but oh well).
Thomas Heller [Wed, 6 Sep 2006 17:48:56 +0000 (17:48 +0000)]
Backport of r51379 from trunk:
Add asserts to check for 'impossible' NULL values, with comments.
In one place where I'm 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.
Georg Brandl [Wed, 6 Sep 2006 06:47:02 +0000 (06:47 +0000)]
Bug #1542051: Exceptions now correctly call PyObject_GC_UnTrack.
Also make sure that every exception class has __module__ set to
'exceptions'.
(backport)
Bug #1520864 (again): unpacking singleton tuples in list comprehensions and
generator expressions (x for x, in ... ) works again.
Sigh, I only fixed for loops the first time, not list comps and genexprs too.
I couldn't find any more unpacking cases where there is a similar bug lurking.
Tim Peters [Tue, 5 Sep 2006 01:47:53 +0000 (01:47 +0000)]
i_divmod(): As discussed on Python-Dev, changed the overflow
checking to live happily with recent gcc optimizations that
assume signed integer arithmetic never overflows.