Tim Peters [Thu, 9 Mar 2006 01:42:24 +0000 (01:42 +0000)]
Simple utility to add svn:eol-style to text files under
SVN control. Like reindent.py, I expect to run this
mindlessly from time to time, checking in whatever it
happens to do ;-)
Georg Brandl [Wed, 8 Mar 2006 18:09:27 +0000 (18:09 +0000)]
Patch #1434038: property() now uses the getter's docstring if there is
no "doc" argument given. This makes it possible to legitimately use
property() as a decorator to produce a read-only property.
Thomas Wouters [Wed, 8 Mar 2006 01:47:19 +0000 (01:47 +0000)]
Clean up _bsddb.c: add a couple dozen missing Py_DECREF()'s, a handful of
missing PyObject_Del()'s, simplify some code by using Py_BuildValue()
instead of creating a tuple with items manually, stop clobbering builtin
exceptions in a few places, and guard against NULL-returning functions some
more.
This fixes 117 of the 780 (!?!#%@#$!!) reference leaks in test_bsddb3. I
ain't not done yet, although this review of 5kloc was just the easy part.
Tim Peters [Tue, 7 Mar 2006 23:53:32 +0000 (23:53 +0000)]
_hotshot hotshot_profiler(): If write_header() returned
an error code, this let `self` leak. This is a disaster
on Windows, since `self` already points to a newly-opened
file object, and it was impossible for Python code to
close the thing since the only reference to it was in a
blob of leaked C memory.
test_hotshot test_bad_sys_path(): This new test provoked
the C bug above. This test passed, but left an open
"@test" file behind, which caused a massive cascade of
bogus test failures in later, unrelated tests on Windows.
Changed the test code to remove the @test file it leaves
behind, which relies on the change above to close that
file first.
Checking in the code for PEP 357.
This was mostly written by Travis Oliphant.
I've inspected it all; Neal Norwitz and MvL have also looked at it
(in an earlier incarnation).
Neal Norwitz [Tue, 7 Mar 2006 04:48:24 +0000 (04:48 +0000)]
Thanks to Coverity, these were all reported by their Prevent tool.
All of these (except _lsprof.c) should be backported. Particularly
the hotshot change which validates sys.path. Can someone backport?
Neal Norwitz [Mon, 6 Mar 2006 23:07:34 +0000 (23:07 +0000)]
Try to cleanup the error handling a bit so there aren't false positives
from static analysis. v was already checked for NULL above, so we don't
need a second check.
Neal Norwitz [Sun, 5 Mar 2006 02:16:12 +0000 (02:16 +0000)]
Backout the last hack and add in this new one.
The failure definitely seems timing related. This change *seems* to work.
Since the failure isn't doesn't occur consistently, it's hard to tell.
Running these tests on Solaris in this order:
test_urllibnet test_operator test_cgi \
test_isinstance test_future test_ast test_logging
generally caused a failure (about 50% of the time) before the sleep.
I couldn't provoke the failure with the sleep.
This should really be cleaned up by using threading.Events or something
so it is not timing dependent and doesn't hang forever on failure.
Neal Norwitz [Sat, 4 Mar 2006 18:52:26 +0000 (18:52 +0000)]
Get rid of run_err_mod(). It was only used in two places.
One place it wasn't necessary since mod was already checked.
Inline the check that mod != NULL for the other use.
Neal Norwitz [Fri, 3 Mar 2006 21:53:14 +0000 (21:53 +0000)]
I think the test_logging failure on Solaris is timing related. We don't
want to wait forever if we don't receive the last message. But we also
don't want the test to fail if we shutdown too quickly. I can't reliably
reproduce this failure, so I'm kinda guessing this is the problem.
We'll see if this band-aid helps.
Thomas Wouters [Fri, 3 Mar 2006 18:16:20 +0000 (18:16 +0000)]
Add support for absolute/relative imports and if/else expressions:
- regenerate ast.py
- add future flags for absolute-import and with-statement so they
(hopefully) properly get set in code-object flags
- try out if/else expressions in actual code for the hell of it.
Seems to generate the same kind of bytecode as the normal compiler.
Thomas Wouters [Thu, 2 Mar 2006 20:41:27 +0000 (20:41 +0000)]
Fix crashing bug in tokenizer, when tokenizing files with non-ASCII bytes
but without a specified encoding: decoding_fgets() (and decoding_feof()) can
return NULL and fiddle with the 'tok' struct, making tok->buf NULL. This is
okay in the other cases of calls to decoding_*(), it seems, but not in this
one.
This should get a test added, somewhere, but the testsuite doesn't seem to
test encoding anywhere (although plenty of tests use it.)
It seems to me that decoding errors in other places in the code (like at the
start of a token, instead of in the middle of one) make the code end up
adding small integers to NULL pointers, but happen to check for error states
before using the calculated new pointers. I haven't been able to trigger any
other crashes, in any case.
I would nominate this file for a comlete rewrite for Py3k. The whole
decoding trick is too bolted-on for my tastes.