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.
Thomas Wouters [Thu, 2 Mar 2006 04:48:27 +0000 (04:48 +0000)]
Py_SAFE_DOWNCAST isn't quite doing the right thing for going from Py_ssize_t
to an unsigned int (and back again) on 64-bit machines, even though the
actual value of the Py_ssize_t variable is way below 31 bits. I suspect
compiler-error.
Fix failure of test_compiler.py when compiling test_contextlib.py.
The culprit was an expression-less yield -- the first apparently in
the standard library. I added a unit test for this.
Also removed the hack to force compilation of test_with.py.
Thomas Wouters [Wed, 1 Mar 2006 22:45:36 +0000 (22:45 +0000)]
Rework channelnumber/samplesize detetion code's output variables a bit to
convince gcc (4.0.x) the variables are never used uninitialized (and raising
a proper exception if they ever are.)
Thomas Wouters [Wed, 1 Mar 2006 22:30:47 +0000 (22:30 +0000)]
Fix gcc (4.0.x) warning about use of uninitialized variables.
(PyMarshal_ReadShortFromFile() is only used in zipimport.c, I don't believe
the extra initializations will matter one way or another.)
Thomas Wouters [Wed, 1 Mar 2006 21:58:30 +0000 (21:58 +0000)]
Remove gcc (4.0.x) warning about uninitialized value by explicitly setting
the sentinel value in the main function, rather than the helper. This
function could possibly do with an early-out if any of the helper calls ends
up with a len of 0, but I doubt it really matters (how common are malformed
hangul syllables, really?)
Brett Cannon [Wed, 1 Mar 2006 06:10:48 +0000 (06:10 +0000)]
Fix parsing of exception_hierarchy.txt when a platform-specific exception is
specified. Hopefully this wll bring warming to Tim's Windows-loving heart.
Thomas Wouters [Wed, 1 Mar 2006 05:41:20 +0000 (05:41 +0000)]
Use %ld and casts to long for refcount printing, in absense of a universally
available %zd format character. Mark with an XXX comment so we can fix this,
later.