]> granicus.if.org Git - python/log
python
18 years agoBackport 51432:
Neal Norwitz [Mon, 21 Aug 2006 18:43:51 +0000 (18:43 +0000)]
Backport 51432:
Fix bug #1543303, tarfile adds padding that breaks gunzip.
Patch # 1543897.  (remove the padding)

18 years agoPatch #1542948: fix urllib2 header casing issue. With new test.
Georg Brandl [Sun, 20 Aug 2006 13:15:43 +0000 (13:15 +0000)]
Patch #1542948: fix urllib2 header casing issue. With new test.
 (backport from rev. 51416)

18 years agoSF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro
Neal Norwitz [Sat, 19 Aug 2006 04:19:43 +0000 (04:19 +0000)]
SF #1542693: Remove semi-colon at end of PyImport_ImportModuleEx macro

18 years agoMove initialization of interned strings to before allocating the
Neal Norwitz [Sat, 19 Aug 2006 04:19:14 +0000 (04:19 +0000)]
Move initialization of interned strings to before allocating the
object so we don't leak op.  (Fixes an earlier patch to this code)

Klockwork #350

18 years agoMove assert to after NULL check, otherwise we deref NULL in the assert.
Neal Norwitz [Sat, 19 Aug 2006 04:18:39 +0000 (04:18 +0000)]
Move assert to after NULL check, otherwise we deref NULL in the assert.

Klocwork #307

18 years agoMinor edits
Andrew M. Kuchling [Fri, 18 Aug 2006 13:54:33 +0000 (13:54 +0000)]
Minor edits

18 years agoTypo in tp_clear docs.
Georg Brandl [Fri, 18 Aug 2006 07:35:53 +0000 (07:35 +0000)]
Typo in tp_clear docs.
 (backport from rev. 51368)

18 years agoBug #1541682: Fix example in the "Refcount details" API docs.
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)

18 years agoBug #1541863: uuid.uuid1 failed to generate unique identifiers
Martin v. Löwis [Fri, 18 Aug 2006 03:40:13 +0000 (03:40 +0000)]
Bug #1541863: uuid.uuid1 failed to generate unique identifiers
on systems with low clock resolution.

18 years agoInvoke debug mk1mf.pl after running Configure.
Martin v. Löwis [Thu, 17 Aug 2006 18:54:43 +0000 (18:54 +0000)]
Invoke debug mk1mf.pl after running Configure.

18 years agoLeave tk build directory to restore original path.
Martin v. Löwis [Thu, 17 Aug 2006 17:27:31 +0000 (17:27 +0000)]
Leave tk build directory to restore original path.

18 years agoTagging for release of Python 2.5c1
Anthony Baxter [Thu, 17 Aug 2006 03:08:55 +0000 (03:08 +0000)]
Tagging for release of Python 2.5c1

18 years agoBranching release25-maint. All further 2.5 releases (including the release candidates, v2.5c1
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.

18 years agoFix a bug in the ``compiler`` package that caused invalid code to be
Neil Schemenauer [Wed, 16 Aug 2006 23:38:05 +0000 (23:38 +0000)]
Fix a bug in the ``compiler`` package that caused invalid code to be
generated for generator expressions.

18 years agoFile menu hotkeys: there were three 'p' assignments. Reassign the
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'.

M    Bindings.py
M    PyShell.py
M    NEWS.txt

18 years agoTutorial:
Thomas Heller [Wed, 16 Aug 2006 18:02:11 +0000 (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.

18 years agoGrammar fix
Andrew M. Kuchling [Wed, 16 Aug 2006 17:11:18 +0000 (17:11 +0000)]
Grammar fix

18 years agoSF#1534630
Fredrik Lundh [Wed, 16 Aug 2006 16:47:07 +0000 (16:47 +0000)]
SF#1534630

ignore data that arrives before the opening start tag

18 years agoAdd NEWS item mentioning the reverted distutils version number patch.
Marc-André Lemburg [Wed, 16 Aug 2006 16:11:01 +0000 (16:11 +0000)]
Add NEWS item mentioning the reverted distutils version number patch.

18 years agoRemove the special casing of Py_None when converting the return value
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)

18 years agoWording/typo fixes
Andrew M. Kuchling [Wed, 16 Aug 2006 14:21:14 +0000 (14:21 +0000)]
Wording/typo fixes

18 years agoUpdate bug/patch counts
Andrew M. Kuchling [Wed, 16 Aug 2006 14:18:23 +0000 (14:18 +0000)]
Update bug/patch counts

18 years agoThe __repr__ method of a NULL py_object does no longer raise an
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.

Includes tests.

18 years agoMake cl build step compile-only (/c). Remove libs from source list.
Martin v. Löwis [Wed, 16 Aug 2006 13:58:51 +0000 (13:58 +0000)]
Make cl build step compile-only (/c). Remove libs from source list.

18 years agoLink to docs; remove an XXX comment
Andrew M. Kuchling [Wed, 16 Aug 2006 13:51:32 +0000 (13:51 +0000)]
Link to docs; remove an XXX comment

18 years agoBump document version to 1.0; remove pystone paragraph
Andrew M. Kuchling [Wed, 16 Aug 2006 13:41:52 +0000 (13:41 +0000)]
Bump document version to 1.0; remove pystone paragraph

18 years agoAdd UnicodeWarning
Andrew M. Kuchling [Wed, 16 Aug 2006 13:22:20 +0000 (13:22 +0000)]
Add UnicodeWarning

18 years agonews entry for 51307
Anthony Baxter [Wed, 16 Aug 2006 13:08:25 +0000 (13:08 +0000)]
news entry for 51307

18 years agoAdd commented assert statements to check that the result of
Thomas Heller [Wed, 16 Aug 2006 13:03:11 +0000 (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.

18 years agoBuild _hashlib on Windows. Build OpenSSL with masm assembler code.
Martin v. Löwis [Wed, 16 Aug 2006 12:55:10 +0000 (12:55 +0000)]
Build _hashlib on Windows. Build OpenSSL with masm assembler code.
Fixes #1535502.

18 years agoRevert to having static version numbers again.
Marc-André Lemburg [Wed, 16 Aug 2006 08:13:26 +0000 (08:13 +0000)]
Revert to having static version numbers again.

18 years agoGet quit() and exit() to work cleanly when not using subprocess.
Kurt B. Kaiser [Wed, 16 Aug 2006 07:04:17 +0000 (07:04 +0000)]
Get quit() and exit() to work cleanly when not using subprocess.

18 years agoUpdate code and tests to support the 'bytes_le' attribute (for
Ka-Ping Yee [Wed, 16 Aug 2006 07:02:50 +0000 (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.

18 years agoPatch #1540892: site.py Quitter() class attempts to close sys.stdin
Kurt B. Kaiser [Wed, 16 Aug 2006 05:01:42 +0000 (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

18 years agopreparing for 2.5c1 - no, really this time
Anthony Baxter [Wed, 16 Aug 2006 03:58:37 +0000 (03:58 +0000)]
preparing for 2.5c1 - no, really this time

18 years agopreparing for 2.5c1
Anthony Baxter [Wed, 16 Aug 2006 03:42:26 +0000 (03:42 +0000)]
preparing for 2.5c1

18 years agoThe 'with' statement is now a Code Context block opener
Kurt B. Kaiser [Wed, 16 Aug 2006 03:15:26 +0000 (03:15 +0000)]
The 'with' statement is now a Code Context block opener

18 years agoCheck for NULL return value from new_CArgObject calls.
Thomas Heller [Tue, 15 Aug 2006 13:07:21 +0000 (13:07 +0000)]
Check for NULL return value from new_CArgObject calls.

18 years agoSubclasses of int/long are allowed to define an __index__.
Neal Norwitz [Tue, 15 Aug 2006 06:29:03 +0000 (06:29 +0000)]
Subclasses of int/long are allowed to define an __index__.

18 years agoUpdate the docstring to use a version a little newer than 1999. This was
Neal Norwitz [Tue, 15 Aug 2006 04:59:30 +0000 (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?

18 years agoFix the test for SocketServer so it should pass on cygwin and not fail
Neal Norwitz [Tue, 15 Aug 2006 04:58:28 +0000 (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

18 years agoGeorg fixed one of my bugs, so I'll repay him with 2 NEWS entries.
Neal Norwitz [Tue, 15 Aug 2006 04:14:57 +0000 (04:14 +0000)]
Georg fixed one of my bugs, so I'll repay him with 2 NEWS entries.
Now we're even. :-)

18 years agoWhitespace normalization.
Tim Peters [Tue, 15 Aug 2006 00:25:04 +0000 (00:25 +0000)]
Whitespace normalization.

18 years agoPatch #1511317: don't crash on invalid hostname info
Georg Brandl [Mon, 14 Aug 2006 22:10:24 +0000 (22:10 +0000)]
Patch #1511317: don't crash on invalid hostname info

18 years agoCookie.py shouldn't "bogusly" use string._idmap.
Georg Brandl [Mon, 14 Aug 2006 22:01:24 +0000 (22:01 +0000)]
Cookie.py shouldn't "bogusly" use string._idmap.

18 years agoPatch #1536071: trace.py should now find the full module name of a
Georg Brandl [Mon, 14 Aug 2006 21:55:28 +0000 (21:55 +0000)]
Patch #1536071: trace.py should now find the full module name of a
file correctly even on Windows.

18 years agoAdd an additional test: BZ2File write methods should raise IOError
Georg Brandl [Mon, 14 Aug 2006 21:45:32 +0000 (21:45 +0000)]
Add an additional test: BZ2File write methods should raise IOError
when file is read-only.

18 years agoPatch #1535500: fix segfault in BZ2File.writelines and make sure it
Georg Brandl [Mon, 14 Aug 2006 21:42:55 +0000 (21:42 +0000)]
Patch #1535500: fix segfault in BZ2File.writelines and make sure it
raises the correct exceptions.

18 years agoMake tabnanny recognize IndentationErrors raised by tokenize.
Georg Brandl [Mon, 14 Aug 2006 21:34:08 +0000 (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)

18 years agoFix refleak introduced in rev. 51248.
Georg Brandl [Mon, 14 Aug 2006 20:25:39 +0000 (20:25 +0000)]
Fix refleak introduced in rev. 51248.

18 years agoNews item for rev 51281.
Thomas Heller [Mon, 14 Aug 2006 16:20:04 +0000 (16:20 +0000)]
News item for rev 51281.

18 years agoPatch #1536908: Add support for AMD64 / OpenBSD.
Thomas Heller [Mon, 14 Aug 2006 16:17:41 +0000 (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.

18 years agoCorrect an accidentally removed previous patch.
Marc-André Lemburg [Mon, 14 Aug 2006 12:57:27 +0000 (12:57 +0000)]
Correct an accidentally removed previous patch.

18 years agoImprove markup in PyUnicode_RichCompare.
Georg Brandl [Mon, 14 Aug 2006 12:36:06 +0000 (12:36 +0000)]
Improve markup in PyUnicode_RichCompare.

18 years agoReadd NEWS items that were accidentally removed by r51276.
Marc-André Lemburg [Mon, 14 Aug 2006 11:44:34 +0000 (11:44 +0000)]
Readd NEWS items that were accidentally removed by r51276.

18 years agoApply the patch #1532975 plus ideas from the patch #1533481.
Thomas Heller [Mon, 14 Aug 2006 11:17:48 +0000 (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.

18 years agoSlightly revised version of patch #1538956:
Marc-André Lemburg [Mon, 14 Aug 2006 10:55:19 +0000 (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.

18 years agoRevert the change that tries to zero out a closure's result storage
Thomas Heller [Mon, 14 Aug 2006 10:02:24 +0000 (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.

18 years agoCheck for NULL return value of GenericCData_new().
Thomas Heller [Mon, 14 Aug 2006 07:50:14 +0000 (07:50 +0000)]
Check for NULL return value of GenericCData_new().
Fixes klockwork issues #188, #189.

18 years agoCheck for NULL return value from new_CArgObject().
Thomas Heller [Mon, 14 Aug 2006 07:14:09 +0000 (07:14 +0000)]
Check for NULL return value from new_CArgObject().
Fixes klockwork issues #183, #184, #185.

18 years agoRemove unused, buggy test function.
Thomas Heller [Mon, 14 Aug 2006 07:13:05 +0000 (07:13 +0000)]
Remove unused, buggy test function.
Fixes klockwork issue #207.

18 years agoUpdate purify doc some.
Neal Norwitz [Mon, 14 Aug 2006 01:49:54 +0000 (01:49 +0000)]
Update purify doc some.

18 years agoCan't return NULL from a void function. If there is a memory error,
Neal Norwitz [Mon, 14 Aug 2006 00:59:03 +0000 (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.

18 years agoIgnore pgen.exe and kill_python.exe for cygwin
Neal Norwitz [Mon, 14 Aug 2006 00:51:15 +0000 (00:51 +0000)]
Ignore pgen.exe and kill_python.exe for cygwin

18 years agoGet rid of compiler warning
Neal Norwitz [Sun, 13 Aug 2006 18:41:15 +0000 (18:41 +0000)]
Get rid of compiler warning

18 years agoHandle alloca failures.
Neal Norwitz [Sun, 13 Aug 2006 18:40:39 +0000 (18:40 +0000)]
Handle alloca failures.

Klocwork 225-228

18 years agoHandle malloc failure.
Neal Norwitz [Sun, 13 Aug 2006 18:13:36 +0000 (18:13 +0000)]
Handle malloc failure.

Klocwork 281

18 years agoReally address the issue of where to place the assert for leftblock.
Neal Norwitz [Sun, 13 Aug 2006 18:13:02 +0000 (18:13 +0000)]
Really address the issue of where to place the assert for leftblock.
(Followup of Klocwork 274)

18 years agoHandle failure from PyModule_GetDict() (Klocwork 208).
Neal Norwitz [Sun, 13 Aug 2006 18:12:45 +0000 (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.

18 years agoHandle failures from lookup.
Neal Norwitz [Sun, 13 Aug 2006 18:12:26 +0000 (18:12 +0000)]
Handle failures from lookup.

Klocwork 341-342

18 years agoIt's very unlikely, though possible that source is not a string. Verify
Neal Norwitz [Sun, 13 Aug 2006 18:12:03 +0000 (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

18 years agoHandle malloc and fopen failures more gracefully.
Neal Norwitz [Sun, 13 Aug 2006 18:11:43 +0000 (18:11 +0000)]
Handle malloc and fopen failures more gracefully.

Klocwork 180-181

18 years agoCheck return result of PyModule_GetDict().
Neal Norwitz [Sun, 13 Aug 2006 18:11:27 +0000 (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.

18 years agoFix segfault when doing string formatting on subclasses of long if
Neal Norwitz [Sun, 13 Aug 2006 18:11:08 +0000 (18:11 +0000)]
Fix segfault when doing string formatting on subclasses of long if
__oct__, __hex__ don't return a string.

Klocwork 308

18 years agocpathname could be NULL if it was longer than MAXPATHLEN. Don't try
Neal Norwitz [Sun, 13 Aug 2006 18:10:47 +0000 (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

18 years agoHandle a whole lot of failures from PyString_FromInternedString().
Neal Norwitz [Sun, 13 Aug 2006 18:10:28 +0000 (18:10 +0000)]
Handle a whole lot of failures from PyString_FromInternedString().

Should fix most of Klocwork 234-272.

18 years agoMove/copy assert for tstate != NULL before first use.
Neal Norwitz [Sun, 13 Aug 2006 18:10:10 +0000 (18:10 +0000)]
Move/copy assert for tstate != NULL before first use.
Verify that PyEval_Get{Globals,Locals} returned valid pointers.

Klocwork 231-232

18 years agoSF bug #1539336, distutils example code missing
Neal Norwitz [Sun, 13 Aug 2006 00:20:49 +0000 (00:20 +0000)]
SF bug #1539336, distutils example code missing

18 years agoFix a couple of bugs exposed by the new __index__ code. The 64-bit buildbots
Neal Norwitz [Sat, 12 Aug 2006 18:44:06 +0000 (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.

18 years agoPatch #1538606, Patch to fix __index__() clipping.
Neal Norwitz [Sat, 12 Aug 2006 17:03:09 +0000 (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.

18 years agoRepair logging test spew caused by rev. 51206.
Georg Brandl [Sat, 12 Aug 2006 08:32:02 +0000 (08:32 +0000)]
Repair logging test spew caused by rev. 51206.

18 years agoAh, fudge. One of the prints here actually "shouldn't be"
Tim Peters [Sat, 12 Aug 2006 05:17:41 +0000 (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.

18 years agotest_signal: Signal handling on the Tru64 buildbot
Tim Peters [Sat, 12 Aug 2006 04:42:47 +0000 (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.

18 years agoVerify verdat which is returned from malloc is not NULL.
Neal Norwitz [Sat, 12 Aug 2006 03:18:50 +0000 (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)

18 years agoPyModule_GetDict() can fail, produce fatal errors if this happens on startup.
Neal Norwitz [Sat, 12 Aug 2006 03:17:41 +0000 (03:17 +0000)]
PyModule_GetDict() can fail, produce fatal errors if this happens on startup.

Klocwork #298-299.

18 years agoCheck return of PyMem_MALLOC (garbage) is non-NULL.
Neal Norwitz [Sat, 12 Aug 2006 03:16:54 +0000 (03:16 +0000)]
Check return of PyMem_MALLOC (garbage) is non-NULL.
Check seq in both portions of if/else.

Klocwork #289-290.

18 years agoDon't deref v if it's NULL.
Neal Norwitz [Sat, 12 Aug 2006 02:33:36 +0000 (02:33 +0000)]
Don't deref v if it's NULL.

Klocwork #214

18 years agoWhoops, how did that get in there. :-) Revert all the parts of 51227 that were not...
Neal Norwitz [Sat, 12 Aug 2006 02:12:30 +0000 (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

18 years agoCheck returned pointer is valid.
Neal Norwitz [Sat, 12 Aug 2006 02:06:34 +0000 (02:06 +0000)]
Check returned pointer is valid.
Klocwork #233

18 years agoI'm not sure why this code allocates this string for the error message.
Neal Norwitz [Sat, 12 Aug 2006 01:57:47 +0000 (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

18 years agoTry to handle a malloc failure. I'm not entirely sure this is correct.
Neal Norwitz [Sat, 12 Aug 2006 01:53:28 +0000 (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

18 years agoMove the assert which checks for a NULL pointer first.
Neal Norwitz [Sat, 12 Aug 2006 01:51:12 +0000 (01:51 +0000)]
Move the assert which checks for a NULL pointer first.
Klocwork #274.

18 years agoIf _stat_float_times is false, we will try to INCREF ival which could be NULL.
Neal Norwitz [Sat, 12 Aug 2006 01:50:38 +0000 (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

18 years agoHandle NULL nodes while parsing. I'm not entirely sure this is correct.
Neal Norwitz [Sat, 12 Aug 2006 01:49:12 +0000 (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.

18 years agoThis code is actually not used unless WITHOUT_COMPLEX is defined.
Neal Norwitz [Sat, 12 Aug 2006 01:47:59 +0000 (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.

18 years agoIt's highly unlikely, though possible for PyEval_Get*() to return NULLs.
Neal Norwitz [Sat, 12 Aug 2006 01:46:42 +0000 (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.

18 years agoEven though _Py_Mangle() isn't truly public anyone can call it and
Neal Norwitz [Sat, 12 Aug 2006 01:45:47 +0000 (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

18 years agoKlocwork made another run and found a bunch more problems.
Neal Norwitz [Sat, 12 Aug 2006 01:43:40 +0000 (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).

18 years agoWhen a ctypes C callback function is called, zero out the result
Thomas Heller [Fri, 11 Aug 2006 19:55:35 +0000 (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.

18 years agoAdd ignore of *.pyc and *.pyo to Lib/xml/etree/.
Thomas Wouters [Fri, 11 Aug 2006 15:02:39 +0000 (15:02 +0000)]
Add ignore of *.pyc and *.pyo to Lib/xml/etree/.