anthony.baxter [Thu, 17 Aug 2006 03:08:55 +0000 (17 03:08 +0000)]
Tagging for release of Python 2.5c1
git-svn-id: http://svn.python.org/projects/python/tags/r25c1@51334 6015fed2-1504-0410-9fe1-9d1591cc4771
anthony.baxter [Thu, 17 Aug 2006 00:38:04 +0000 (17 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.
git-svn-id: http://svn.python.org/projects/python/branches/release25-maint@51333 6015fed2-1504-0410-9fe1-9d1591cc4771
neil.schemenauer [Wed, 16 Aug 2006 23:38:05 +0000 (16 23:38 +0000)]
Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.
git-svn-id: http://svn.python.org/projects/python/trunk@51330 6015fed2-1504-0410-9fe1-9d1591cc4771
kurt.kaiser [Wed, 16 Aug 2006 21:45:59 +0000 (16 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'.
M Bindings.py
M PyShell.py
M NEWS.txt
git-svn-id: http://svn.python.org/projects/python/trunk@51329 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Wed, 16 Aug 2006 18:02:11 +0000 (16 18:02 +0000)]
Tutorial:
Clarify somewhat how parameters are passed to functions
(especially explain what integer means).
Correct the table - Python integers and longs can both be used.
Further clarification to the table comparing ctypes types, Python
types, and C types.
Reference:
Replace integer by C ``int`` where it makes sense.
git-svn-id: http://svn.python.org/projects/python/trunk@51328 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 17:11:18 +0000 (16 17:11 +0000)]
Grammar fix
git-svn-id: http://svn.python.org/projects/python/trunk@51324 6015fed2-1504-0410-9fe1-9d1591cc4771
fredrik.lundh [Wed, 16 Aug 2006 16:47:07 +0000 (16 16:47 +0000)]
SF#
1534630
ignore data that arrives before the opening start tag
git-svn-id: http://svn.python.org/projects/python/trunk@51322 6015fed2-1504-0410-9fe1-9d1591cc4771
marc-andre.lemburg [Wed, 16 Aug 2006 16:11:01 +0000 (16 16:11 +0000)]
Add NEWS item mentioning the reverted distutils version number patch.
git-svn-id: http://svn.python.org/projects/python/trunk@51321 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Wed, 16 Aug 2006 15:10:12 +0000 (16 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)
git-svn-id: http://svn.python.org/projects/python/trunk@51320 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 14:21:14 +0000 (16 14:21 +0000)]
Wording/typo fixes
git-svn-id: http://svn.python.org/projects/python/trunk@51319 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 14:18:23 +0000 (16 14:18 +0000)]
Update bug/patch counts
git-svn-id: http://svn.python.org/projects/python/trunk@51318 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Wed, 16 Aug 2006 14:07:44 +0000 (16 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.
Includes tests.
git-svn-id: http://svn.python.org/projects/python/trunk@51317 6015fed2-1504-0410-9fe1-9d1591cc4771
martin.v.loewis [Wed, 16 Aug 2006 13:58:51 +0000 (16 13:58 +0000)]
Make cl build step compile-only (/c). Remove libs from source list.
git-svn-id: http://svn.python.org/projects/python/trunk@51316 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 13:51:32 +0000 (16 13:51 +0000)]
Link to docs; remove an XXX comment
git-svn-id: http://svn.python.org/projects/python/trunk@51315 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 13:41:52 +0000 (16 13:41 +0000)]
Bump document version to 1.0; remove pystone paragraph
git-svn-id: http://svn.python.org/projects/python/trunk@51314 6015fed2-1504-0410-9fe1-9d1591cc4771
andrew.kuchling [Wed, 16 Aug 2006 13:22:20 +0000 (16 13:22 +0000)]
Add UnicodeWarning
git-svn-id: http://svn.python.org/projects/python/trunk@51313 6015fed2-1504-0410-9fe1-9d1591cc4771
anthony.baxter [Wed, 16 Aug 2006 13:08:25 +0000 (16 13:08 +0000)]
news entry for 51307
git-svn-id: http://svn.python.org/projects/python/trunk@51312 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Wed, 16 Aug 2006 13:03:11 +0000 (16 13:03 +0000)]
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.
git-svn-id: http://svn.python.org/projects/python/trunk@51311 6015fed2-1504-0410-9fe1-9d1591cc4771
martin.v.loewis [Wed, 16 Aug 2006 12:55:10 +0000 (16 12:55 +0000)]
Build _hashlib on Windows. Build OpenSSL with masm assembler code.
Fixes #
1535502.
git-svn-id: http://svn.python.org/projects/python/trunk@51310 6015fed2-1504-0410-9fe1-9d1591cc4771
marc-andre.lemburg [Wed, 16 Aug 2006 08:13:26 +0000 (16 08:13 +0000)]
Revert to having static version numbers again.
git-svn-id: http://svn.python.org/projects/python/trunk@51309 6015fed2-1504-0410-9fe1-9d1591cc4771
kurt.kaiser [Wed, 16 Aug 2006 07:04:17 +0000 (16 07:04 +0000)]
Get quit() and exit() to work cleanly when not using subprocess.
git-svn-id: http://svn.python.org/projects/python/trunk@51308 6015fed2-1504-0410-9fe1-9d1591cc4771
ka-ping.yee [Wed, 16 Aug 2006 07:02:50 +0000 (16 07:02 +0000)]
Update code and tests to support the 'bytes_le' attribute (for
little-endian byte order on Windows), and to work around clocks
with low resolution yielding duplicate UUIDs.
Anthony Baxter has approved this change.
git-svn-id: http://svn.python.org/projects/python/trunk@51307 6015fed2-1504-0410-9fe1-9d1591cc4771
kurt.kaiser [Wed, 16 Aug 2006 05:01:42 +0000 (16 05:01 +0000)]
Patch #
1540892: site.py Quitter() class attempts to close sys.stdin
before raising SystemExit, allowing IDLE to honor quit() and exit().
M Lib/site.py
M Lib/idlelib/PyShell.py
M Lib/idlelib/CREDITS.txt
M Lib/idlelib/NEWS.txt
M Misc/NEWS
git-svn-id: http://svn.python.org/projects/python/trunk@51306 6015fed2-1504-0410-9fe1-9d1591cc4771
anthony.baxter [Wed, 16 Aug 2006 03:58:37 +0000 (16 03:58 +0000)]
preparing for 2.5c1 - no, really this time
git-svn-id: http://svn.python.org/projects/python/trunk@51305 6015fed2-1504-0410-9fe1-9d1591cc4771
anthony.baxter [Wed, 16 Aug 2006 03:42:26 +0000 (16 03:42 +0000)]
preparing for 2.5c1
git-svn-id: http://svn.python.org/projects/python/trunk@51304 6015fed2-1504-0410-9fe1-9d1591cc4771
kurt.kaiser [Wed, 16 Aug 2006 03:15:26 +0000 (16 03:15 +0000)]
The 'with' statement is now a Code Context block opener
git-svn-id: http://svn.python.org/projects/python/trunk@51303 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Tue, 15 Aug 2006 13:07:21 +0000 (15 13:07 +0000)]
Check for NULL return value from new_CArgObject calls.
git-svn-id: http://svn.python.org/projects/python/trunk@51300 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Tue, 15 Aug 2006 06:29:03 +0000 (15 06:29 +0000)]
Subclasses of int/long are allowed to define an __index__.
git-svn-id: http://svn.python.org/projects/python/trunk@51298 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Tue, 15 Aug 2006 04:59:30 +0000 (15 04:59 +0000)]
Update the docstring to use a version a little newer than 1999. This was
taken from a Debian patch. Should we update the version for each release?
git-svn-id: http://svn.python.org/projects/python/trunk@51296 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Tue, 15 Aug 2006 04:58:28 +0000 (15 04:58 +0000)]
Fix the test for SocketServer so it should pass on cygwin and not fail
sporadically on other platforms. This is really a band-aid that doesn't
fix the underlying issue in SocketServer. It's not clear if it's worth
it to fix SocketServer, however, I opened a bug to track it:
http://python.org/sf/
1540386
git-svn-id: http://svn.python.org/projects/python/trunk@51295 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Tue, 15 Aug 2006 04:14:57 +0000 (15 04:14 +0000)]
Georg fixed one of my bugs, so I'll repay him with 2 NEWS entries.
Now we're even. :-)
git-svn-id: http://svn.python.org/projects/python/trunk@51293 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Tue, 15 Aug 2006 00:25:04 +0000 (15 00:25 +0000)]
Whitespace normalization.
git-svn-id: http://svn.python.org/projects/python/trunk@51292 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 22:10:24 +0000 (14 22:10 +0000)]
Patch #
1511317: don't crash on invalid hostname info
git-svn-id: http://svn.python.org/projects/python/trunk@51291 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 22:01:24 +0000 (14 22:01 +0000)]
Cookie.py shouldn't "bogusly" use string._idmap.
git-svn-id: http://svn.python.org/projects/python/trunk@51290 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 21:55:28 +0000 (14 21:55 +0000)]
Patch #
1536071: trace.py should now find the full module name of a
file correctly even on Windows.
git-svn-id: http://svn.python.org/projects/python/trunk@51289 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 21:45:32 +0000 (14 21:45 +0000)]
Add an additional test: BZ2File write methods should raise IOError
when file is read-only.
git-svn-id: http://svn.python.org/projects/python/trunk@51287 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 21:42:55 +0000 (14 21:42 +0000)]
Patch #
1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.
git-svn-id: http://svn.python.org/projects/python/trunk@51285 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 21:34:08 +0000 (14 21:34 +0000)]
Make tabnanny recognize IndentationErrors raised by tokenize.
Add a test to test_inspect to make sure indented source
is recognized correctly. (fixes #
1224621)
git-svn-id: http://svn.python.org/projects/python/trunk@51284 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 20:25:39 +0000 (14 20:25 +0000)]
Fix refleak introduced in rev. 51248.
git-svn-id: http://svn.python.org/projects/python/trunk@51283 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 16:20:04 +0000 (14 16:20 +0000)]
News item for rev 51281.
git-svn-id: http://svn.python.org/projects/python/trunk@51282 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 16:17:41 +0000 (14 16:17 +0000)]
Patch #
1536908: Add support for AMD64 / OpenBSD.
Remove the -no-stack-protector compiler flag for OpenBSD
as it has been reported to be unneeded.
git-svn-id: http://svn.python.org/projects/python/trunk@51281 6015fed2-1504-0410-9fe1-9d1591cc4771
marc-andre.lemburg [Mon, 14 Aug 2006 12:57:27 +0000 (14 12:57 +0000)]
Correct an accidentally removed previous patch.
git-svn-id: http://svn.python.org/projects/python/trunk@51280 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Mon, 14 Aug 2006 12:36:06 +0000 (14 12:36 +0000)]
Improve markup in PyUnicode_RichCompare.
git-svn-id: http://svn.python.org/projects/python/trunk@51279 6015fed2-1504-0410-9fe1-9d1591cc4771
marc-andre.lemburg [Mon, 14 Aug 2006 11:44:34 +0000 (14 11:44 +0000)]
Readd NEWS items that were accidentally removed by r51276.
git-svn-id: http://svn.python.org/projects/python/trunk@51278 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 11:17:48 +0000 (14 11:17 +0000)]
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.
git-svn-id: http://svn.python.org/projects/python/trunk@51277 6015fed2-1504-0410-9fe1-9d1591cc4771
marc-andre.lemburg [Mon, 14 Aug 2006 10:55:19 +0000 (14 10:55 +0000)]
Slightly revised version of patch #
1538956:
Replace UnicodeDecodeErrors raised during == and !=
compares of Unicode and other objects with a new
UnicodeWarning.
All other comparisons continue to raise exceptions.
Exceptions other than UnicodeDecodeErrors are also left
untouched.
git-svn-id: http://svn.python.org/projects/python/trunk@51276 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 10:02:24 +0000 (14 10:02 +0000)]
Revert the change that tries to zero out a closure's result storage
area because the size if unknown in source/callproc.c.
git-svn-id: http://svn.python.org/projects/python/trunk@51274 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 07:50:14 +0000 (14 07:50 +0000)]
Check for NULL return value of GenericCData_new().
Fixes klockwork issues #188, #189.
git-svn-id: http://svn.python.org/projects/python/trunk@51266 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 07:14:09 +0000 (14 07:14 +0000)]
Check for NULL return value from new_CArgObject().
Fixes klockwork issues #183, #184, #185.
git-svn-id: http://svn.python.org/projects/python/trunk@51265 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Mon, 14 Aug 2006 07:13:05 +0000 (14 07:13 +0000)]
Remove unused, buggy test function.
Fixes klockwork issue #207.
git-svn-id: http://svn.python.org/projects/python/trunk@51264 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Mon, 14 Aug 2006 01:49:54 +0000 (14 01:49 +0000)]
Update purify doc some.
git-svn-id: http://svn.python.org/projects/python/trunk@51263 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Mon, 14 Aug 2006 00:59:03 +0000 (14 00:59 +0000)]
Can't return NULL from a void function. If there is a memory error,
about the best we can do is call PyErr_WriteUnraisable and go on.
We won't be able to do the call below either, so verify delstr is valid.
git-svn-id: http://svn.python.org/projects/python/trunk@51262 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Mon, 14 Aug 2006 00:51:15 +0000 (14 00:51 +0000)]
Ignore pgen.exe and kill_python.exe for cygwin
git-svn-id: http://svn.python.org/projects/python/trunk@51261 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:41:15 +0000 (13 18:41 +0000)]
Get rid of compiler warning
git-svn-id: http://svn.python.org/projects/python/trunk@51259 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:40:39 +0000 (13 18:40 +0000)]
Handle alloca failures.
Klocwork 225-228
git-svn-id: http://svn.python.org/projects/python/trunk@51258 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:13:36 +0000 (13 18:13 +0000)]
Handle malloc failure.
Klocwork 281
git-svn-id: http://svn.python.org/projects/python/trunk@51256 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:13:02 +0000 (13 18:13 +0000)]
Really address the issue of where to place the assert for leftblock.
(Followup of Klocwork 274)
git-svn-id: http://svn.python.org/projects/python/trunk@51255 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:12:45 +0000 (13 18:12 +0000)]
Handle failure from PyModule_GetDict() (Klocwork 208).
Fix a bunch of refleaks in the init of the module. This would only be found
when running python -v.
git-svn-id: http://svn.python.org/projects/python/trunk@51254 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:12:26 +0000 (13 18:12 +0000)]
Handle failures from lookup.
Klocwork 341-342
git-svn-id: http://svn.python.org/projects/python/trunk@51253 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:12:03 +0000 (13 18:12 +0000)]
It's very unlikely, though possible that source is not a string. Verify
that PyString_AsString() returns a valid pointer. (The problem can
arise when zlib.decompress doesn't return a string.)
Klocwork 346
git-svn-id: http://svn.python.org/projects/python/trunk@51252 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:11:43 +0000 (13 18:11 +0000)]
Handle malloc and fopen failures more gracefully.
Klocwork 180-181
git-svn-id: http://svn.python.org/projects/python/trunk@51251 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:11:27 +0000 (13 18:11 +0000)]
Check return result of PyModule_GetDict().
Fix a bunch of refleaks in the init of the module. This would only be found
when running python -v.
git-svn-id: http://svn.python.org/projects/python/trunk@51250 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:11:08 +0000 (13 18:11 +0000)]
Fix segfault when doing string formatting on subclasses of long if
__oct__, __hex__ don't return a string.
Klocwork 308
git-svn-id: http://svn.python.org/projects/python/trunk@51248 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:10:47 +0000 (13 18:10 +0000)]
cpathname could be NULL if it was longer than MAXPATHLEN. Don't try
to write the .pyc to NULL.
Check results of PyList_GetItem() and PyModule_GetDict() are not NULL.
Klocwork 282, 283, 285
git-svn-id: http://svn.python.org/projects/python/trunk@51247 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:10:28 +0000 (13 18:10 +0000)]
Handle a whole lot of failures from PyString_FromInternedString().
Should fix most of Klocwork 234-272.
git-svn-id: http://svn.python.org/projects/python/trunk@51246 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 18:10:10 +0000 (13 18:10 +0000)]
Move/copy assert for tstate != NULL before first use.
Verify that PyEval_Get{Globals,Locals} returned valid pointers.
Klocwork 231-232
git-svn-id: http://svn.python.org/projects/python/trunk@51245 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sun, 13 Aug 2006 00:20:49 +0000 (13 00:20 +0000)]
SF bug #
1539336, distutils example code missing
git-svn-id: http://svn.python.org/projects/python/trunk@51240 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 18:44:06 +0000 (12 18:44 +0000)]
Fix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots
were failing due to inappropriate clipping of numbers larger than 2**31
with new-style classes. (typeobject.c) In reviewing the code for classic
classes, there were 2 problems. Any negative value return could be returned.
Always return -1 if there was an error. Also make the checks similar
with the new-style classes. I believe this is correct for 32 and 64 bit
boxes, including Windows64.
Add a test of classic classes too.
git-svn-id: http://svn.python.org/projects/python/trunk@51238 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 17:03:09 +0000 (12 17:03 +0000)]
Patch #
1538606, Patch to fix __index__() clipping.
I modified this patch some by fixing style, some error checking, and adding
XXX comments. This patch requires review and some changes are to be expected.
I'm checking in now to get the greatest possible review and establish a
baseline for moving forward. I don't want this to hold up release if possible.
git-svn-id: http://svn.python.org/projects/python/trunk@51236 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Sat, 12 Aug 2006 08:32:02 +0000 (12 08:32 +0000)]
Repair logging test spew caused by rev. 51206.
git-svn-id: http://svn.python.org/projects/python/trunk@51235 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Sat, 12 Aug 2006 05:17:41 +0000 (12 05:17 +0000)]
Ah, fudge. One of the prints here actually "shouldn't be"
protected by "if verbose:", which caused the test to fail on
all non-Windows boxes.
Note that I deliberately didn't convert this to unittest yet,
because I expect it would be even harder to debug this on Tru64
after conversion.
git-svn-id: http://svn.python.org/projects/python/trunk@51234 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Sat, 12 Aug 2006 04:42:47 +0000 (12 04:42 +0000)]
test_signal: Signal handling on the Tru64 buildbot
appears to be utterly insane. Plug some theoretical
insecurities in the test script:
- Verify that the SIGALRM handler was actually installed.
- Don't call alarm() before the handler is installed.
- Move everything that can fail inside the try/finally,
so the test cleans up after itself more often.
- Try sending all the expected signals in
force_test_exit(), not just SIGALRM. Since that was
fixed to actually send SIGALRM (instead of invisibly
dying with an AttributeError), we've seen that sending
SIGALRM alone does not stop this from hanging.
- Move the "kill the child" business into the finally
clause, so the child doesn't survive test failure
to send SIGALRM to other tests later (there are also
baffling SIGALRM-related failures in test_socket).
- Cancel the alarm in the finally clause -- if the
test dies early, we again don't want SIGALRM showing
up to confuse a later test.
Alas, this still relies on timing luck wrt the spawned
script that sends the test signals, but it's hard to see
how waiting for seconds can so often be so unlucky.
test_threadedsignals: curiously, this test never fails
on Tru64, but doesn't normally signal SIGALRM. Anyway,
fixed an obvious (but probably inconsequential) logic
error.
git-svn-id: http://svn.python.org/projects/python/trunk@51233 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 03:18:50 +0000 (12 03:18 +0000)]
Verify verdat which is returned from malloc is not NULL.
Ensure we don't pass NULL to free.
Klocwork #306 (at least the first part, checking malloc)
git-svn-id: http://svn.python.org/projects/python/trunk@51232 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 03:17:41 +0000 (12 03:17 +0000)]
PyModule_GetDict() can fail, produce fatal errors if this happens on startup.
Klocwork #298-299.
git-svn-id: http://svn.python.org/projects/python/trunk@51231 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 03:16:54 +0000 (12 03:16 +0000)]
Check return of PyMem_MALLOC (garbage) is non-NULL.
Check seq in both portions of if/else.
Klocwork #289-290.
git-svn-id: http://svn.python.org/projects/python/trunk@51230 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 02:33:36 +0000 (12 02:33 +0000)]
Don't deref v if it's NULL.
Klocwork #214
git-svn-id: http://svn.python.org/projects/python/trunk@51229 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 02:12:30 +0000 (12 02:12 +0000)]
Whoops, how did that get in there. :-) Revert all the parts of 51227 that were not supposed to go it. Only Modules/_ctypes/cfields.c was supposed to be changed
git-svn-id: http://svn.python.org/projects/python/trunk@51228 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 02:06:34 +0000 (12 02:06 +0000)]
Check returned pointer is valid.
Klocwork #233
git-svn-id: http://svn.python.org/projects/python/trunk@51227 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:57:47 +0000 (12 01:57 +0000)]
I'm not sure why this code allocates this string for the error message.
I think it would be better to always use snprintf and have the format
limit the size of the name appropriately (like %.200s).
Klocwork #340
git-svn-id: http://svn.python.org/projects/python/trunk@51226 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:53:28 +0000 (12 01:53 +0000)]
Try to handle a malloc failure. I'm not entirely sure this is correct.
There might be something else we need to do to handle the exception.
Klocwork # 212-213
git-svn-id: http://svn.python.org/projects/python/trunk@51225 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:51:12 +0000 (12 01:51 +0000)]
Move the assert which checks for a NULL pointer first.
Klocwork #274.
git-svn-id: http://svn.python.org/projects/python/trunk@51224 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:50:38 +0000 (12 01:50 +0000)]
If _stat_float_times is false, we will try to INCREF ival which could be NULL.
Return early in that case. The caller checks for PyErr_Occurred so this
should be ok.
Klocwork #297
git-svn-id: http://svn.python.org/projects/python/trunk@51223 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:49:12 +0000 (12 01:49 +0000)]
Handle NULL nodes while parsing. I'm not entirely sure this is correct.
There might be something else that needs to be done to setup the error.
Klocwork #295.
git-svn-id: http://svn.python.org/projects/python/trunk@51222 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:47:59 +0000 (12 01:47 +0000)]
This code is actually not used unless WITHOUT_COMPLEX is defined.
However, there was no error checking that PyFloat_FromDouble returned
a valid pointer. I believe this change is correct as it seemed
to follow other code in the area.
Klocwork # 292.
git-svn-id: http://svn.python.org/projects/python/trunk@51221 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:46:42 +0000 (12 01:46 +0000)]
It's highly unlikely, though possible for PyEval_Get*() to return NULLs.
So be safe and do an XINCREF.
Klocwork # 221-222.
git-svn-id: http://svn.python.org/projects/python/trunk@51220 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:45:47 +0000 (12 01:45 +0000)]
Even though _Py_Mangle() isn't truly public anyone can call it and
there was no verification that privateobj was a PyString. If it wasn't
a string, this could have allowed a NULL pointer to creep in below and crash.
I wonder if this should be PyString_CheckExact? Must identifiers be strings
or can they be subclasses?
Klocwork #275
git-svn-id: http://svn.python.org/projects/python/trunk@51219 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Sat, 12 Aug 2006 01:43:40 +0000 (12 01:43 +0000)]
Klocwork made another run and found a bunch more problems.
This is the first batch of fixes that should be easy to verify based on context.
This fixes problem numbers: 220 (ast), 323-324 (symtable),
321-322 (structseq), 215 (array), 210 (hotshot), 182 (codecs), 209 (etree).
git-svn-id: http://svn.python.org/projects/python/trunk@51218 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.heller [Fri, 11 Aug 2006 19:55:35 +0000 (11 19:55 +0000)]
When a ctypes C callback function is called, zero out the result
storage before converting the result to C data. See the comment in
the code for details.
Provide a better context for errors when the conversion of a callback
function's result cannot be converted.
git-svn-id: http://svn.python.org/projects/python/trunk@51215 6015fed2-1504-0410-9fe1-9d1591cc4771
thomas.wouters [Fri, 11 Aug 2006 15:02:39 +0000 (11 15:02 +0000)]
Add ignore of *.pyc and *.pyo to Lib/xml/etree/.
git-svn-id: http://svn.python.org/projects/python/trunk@51212 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Fri, 11 Aug 2006 07:26:10 +0000 (11 07:26 +0000)]
logging's atexit hook now runs even if the rest of the module has
already been cleaned up.
git-svn-id: http://svn.python.org/projects/python/trunk@51206 6015fed2-1504-0410-9fe1-9d1591cc4771
georg.brandl [Fri, 11 Aug 2006 07:15:38 +0000 (11 07:15 +0000)]
Add Chris McDonough (latest cgi.py patch)
git-svn-id: http://svn.python.org/projects/python/trunk@51205 6015fed2-1504-0410-9fe1-9d1591cc4771
neal.norwitz [Fri, 11 Aug 2006 06:09:41 +0000 (11 06:09 +0000)]
Fix the failures on cygwin (2006-08-10 fixed the actual locking issue).
The first hunk changes the colon to an ! like other Windows variants.
We need to always wait on the child so the lock gets released and
no other tests fail. This is the try/finally in the second hunk.
git-svn-id: http://svn.python.org/projects/python/trunk@51202 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Fri, 11 Aug 2006 03:49:10 +0000 (11 03:49 +0000)]
force_test_exit(): This has been completely ineffective
at stopping test_signal from hanging forever on the Tru64
buildbot. That could be because there's no such thing as
signal.SIGALARM. Changed to the idiotic (but standard)
signal.SIGALRM instead, and added some more debug output.
git-svn-id: http://svn.python.org/projects/python/trunk@51199 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Fri, 11 Aug 2006 00:49:01 +0000 (11 00:49 +0000)]
test_PyThreadState_SetAsyncExc(): This is failing on some
64-bit boxes. I have no idea what the ctypes docs mean
by "integers", and blind-guessing here that it intended to
mean the signed C "int" type, in which case perhaps I can
repair this by feeding the thread id argument to type
ctypes.c_long().
Also made the worker thread daemonic, so it doesn't hang
Python shutdown if the test continues to fail.
git-svn-id: http://svn.python.org/projects/python/trunk@51198 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Thu, 10 Aug 2006 23:22:13 +0000 (10 23:22 +0000)]
Whitespace normalization broke test_cgi, because a line
of quoted test data relied on preserving a single trailing
blank. Changed the string from raw to regular, and forced
in the trailing blank via an explicit \x20 escape.
git-svn-id: http://svn.python.org/projects/python/trunk@51197 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Thu, 10 Aug 2006 22:48:45 +0000 (10 22:48 +0000)]
Whitespace normalization.
git-svn-id: http://svn.python.org/projects/python/trunk@51196 6015fed2-1504-0410-9fe1-9d1591cc4771
tim.peters [Thu, 10 Aug 2006 22:45:34 +0000 (10 22:45 +0000)]
Followup to bug #
1069160.
PyThreadState_SetAsyncExc(): internal correctness changes wrt
refcount safety and deadlock avoidance. Also added a basic test
case (relying on ctypes) and repaired the docs.
git-svn-id: http://svn.python.org/projects/python/trunk@51195 6015fed2-1504-0410-9fe1-9d1591cc4771
martin.v.loewis [Thu, 10 Aug 2006 19:04:00 +0000 (10 19:04 +0000)]
Update dangling references to the 3.2 database to
mention that this is UCD 4.1 now.
git-svn-id: http://svn.python.org/projects/python/trunk@51194 6015fed2-1504-0410-9fe1-9d1591cc4771
guido.van.rossum [Thu, 10 Aug 2006 18:09:25 +0000 (10 18:09 +0000)]
Fix title -- it's rc1, not beta3.
git-svn-id: http://svn.python.org/projects/python/trunk@51192 6015fed2-1504-0410-9fe1-9d1591cc4771
guido.van.rossum [Thu, 10 Aug 2006 17:42:50 +0000 (10 17:42 +0000)]
News item for SF bug
1112549.
git-svn-id: http://svn.python.org/projects/python/trunk@51191 6015fed2-1504-0410-9fe1-9d1591cc4771