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.
Georg Brandl [Fri, 18 Aug 2006 07:28:03 +0000 (07:28 +0000)]
Bug #1541682: Fix example in the "Refcount details" API docs.
Additionally, remove a faulty example showing PySequence_SetItem applied
to a newly created list object and add notes that this isn't a good idea.
(backport from rev. 51364)
Anthony Baxter [Thu, 17 Aug 2006 00:38:04 +0000 (00:38 +0000)]
Branching release25-maint. All further 2.5 releases (including the release candidates,
the final release and all bugfix releases) will be from this branch, not the trunk.
Kurt B. Kaiser [Wed, 16 Aug 2006 21:45:59 +0000 (21:45 +0000)]
File menu hotkeys: there were three 'p' assignments. Reassign the
'Save Copy As' and 'Print' hotkeys to 'y' and 't'. Change the
Shell menu hotkey from 's' to 'l'.
Thomas Heller [Wed, 16 Aug 2006 15:10:12 +0000 (15:10 +0000)]
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)
Thomas Heller [Wed, 16 Aug 2006 14:07:44 +0000 (14:07 +0000)]
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.