Georg Brandl [Mon, 11 Sep 2006 09:38:35 +0000 (09:38 +0000)]
Forward-port of rev. 51857:
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.
Remove the __unicode__ method from exceptions. Allows unicode() to be called
on exception classes. Would require introducing a tp_unicode slot to make it
work otherwise.
Thomas Heller [Thu, 7 Sep 2006 19:09:54 +0000 (19:09 +0000)]
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.
Thomas Heller [Thu, 7 Sep 2006 18:56:28 +0000 (18:56 +0000)]
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).
[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.
Update the PCBuild8 solution.
Facilitate cross-compilation by having binaries in separate Win32 and x64 directories.
Rationalized configs by making proper use of platforms/configurations.
Remove pythoncore_pgo project.
Add new PGIRelease and PGORelease configurations to perform Profile Guided Optimisation.
Removed I64 support, but this can be easily added by copying the x64 platform settings.
[Bug #1526834] Fix crash in pdb when you do 'b f(';
the function name was placed into a regex pattern and the unbalanced paren
caused re.compile() to report an error
[Bug #1525469] SimpleXMLRPCServer still uses the sys.exc_{value,type} module-level globals instead of calling sys.exc_info(). Reported by Russell Warren
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.
Add a comment about some refactoring. (There's probably more that should be done.) I will reformat this file in the next checkin due to the inconsistent tabs/spaces.
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.
This code should be refactored to eliminate the duplication. I'm sure
the listcomp/genexpr code can be refactored. I'm not sure if the for loop
can re-use any of the same code though.
Tim Peters [Tue, 5 Sep 2006 02:18:09 +0000 (02:18 +0000)]
"Conceptual" merge of rev 51711 from the 2.5 branch.
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.
This differs from the corresponding change on the 2.5 and 2.4
branches, using a less obscure approach, but one that /may/
tickle platform idiocies in their definitions of LONG_MIN.
The 2.4 + 2.5 change avoided introducing a dependence on
LONG_MIN, at the cost of substantially goofier code.
Hmm, this test has failed at least twice recently on the OpenBSD and
Debian sparc buildbots. Since this goes through a lot of tests
and hits the disk a lot it could be slow (especially if NFS is involved).
I'm not sure if that's the problem, but printing periodic msgs shouldn't hurt.
The code was stolen from test_compiler.
Nick Coghlan [Thu, 31 Aug 2006 12:00:43 +0000 (12:00 +0000)]
Fix the wrongheaded implementation of context management in the decimal module and add unit tests. (python-dev discussion is ongoing regarding what we do about Python 2.5)
Jack Diederich [Sat, 26 Aug 2006 18:42:06 +0000 (18:42 +0000)]
- Move functions common to all path modules into genericpath.py and have the
OS speicifc path modules import them.
- Have os2emxpath import common functions fron ntpath instead of using copies
Armin Rigo [Fri, 25 Aug 2006 12:44:28 +0000 (12:44 +0000)]
The regular expression engine in '_sre' can segfault when interpreting
bogus bytecode. It is unclear whether this is a real bug or a "won't
fix" case like bogus_code_obj.py.
Thomas Heller [Fri, 25 Aug 2006 09:26:33 +0000 (09:26 +0000)]
Build _ctypes.pyd for win AMD64 into the MSVC project file.
Since MSVC doesn't know about .asm files, a helper batch file is needed
to find ml64.exe in predefined locations. The helper script hardcodes
the path to the MS Platform SDK.
Thomas Wouters [Thu, 24 Aug 2006 18:40:20 +0000 (18:40 +0000)]
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.)
Alex Martelli [Wed, 23 Aug 2006 22:17:59 +0000 (22:17 +0000)]
Reverting the patch that tried to fix the issue whereby x**2 raises
OverflowError while x*x succeeds and produces infinity; apparently
these inconsistencies cannot be fixed across ``all'' platforms and
there's a widespread feeling that therefore ``every'' platform
should keep suffering forevermore. Ah well.
Jeremy Hylton [Wed, 23 Aug 2006 21:14:03 +0000 (21:14 +0000)]
Bug fixes large and small for tokenize.
Small: Always generate a NL or NEWLINE token following
a COMMENT token. The old code did not generate an NL token if
the comment was on a line by itself.
Large: The output of untokenize() will now match the
input exactly if it is passed the full token sequence. The
old, crufty output is still generated if a limited input
sequence is provided, where limited means that it does not
include position information for tokens.
Remaining bug: There is no CONTINUATION token (\) so there is no way
for untokenize() to handle such code.
Also, expanded the number of doctests in hopes of eventually removing
the old-style tests that compare against a golden file.
Alex Martelli [Wed, 23 Aug 2006 20:42:02 +0000 (20:42 +0000)]
x**2 should about equal x*x (including for a float x such that the result is
inf) but didn't; added a test to test_float to verify that, and ignored the
ERANGE value for errno in the pow operation to make the new test pass (with
help from Marilyn Davis at the Google Python Sprint -- thanks!).