Add empty __init__ methods for stateful multibytecodec instances.
This resolves a problem found by Thomas Wouters:
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Fix test_scriptpackage with pure will power.
I really don't know why I bother; these are all generated files.
But I don't recall how to regenerate them nor how to fix the generator.
The hardest part was fixing two mutual recursive imports;
somehow changing "import foo" into "from . import foo" where
foo and bar import each other AND both are imported from __init__.py
caused things to break. Bah.
Fix the unit tests by adding dispatch tables for DateTime and Binary.
I'm not convinced this is the right thing to do... InstanceType makes no sense any longer.
Thomas Wouters [Fri, 21 Apr 2006 10:40:58 +0000 (10:40 +0000)]
Merge p3yk branch with the trunk up to revision 45595. This breaks a fair
number of tests, all because of the codecs/_multibytecodecs issue described
here (it's not a Py3K issue, just something Py3K discovers):
http://mail.python.org/pipermail/python-dev/2006-April/064051.html
Hye-Shik Chang promised to look for a fix, so no need to fix it here. The
tests that are expected to break are:
Thomas Wouters [Fri, 21 Apr 2006 09:46:12 +0000 (09:46 +0000)]
Merge trunk's 43068, deleting re.py. This leaves the branch in a broken
state (unless you happen to have a re.pyc lying around), but it'll be fixed
in the next merge.
Thomas Wouters [Fri, 21 Apr 2006 09:43:23 +0000 (09:43 +0000)]
Merge part of the trunk changes into the p3yk branch. This merges from 43030
(branch-creation time) up to 43067. 43068 and 43069 contain a little
swapping action between re.py and sre.py, and this mightily confuses svn
merge, so later changes are going in separately.
This merge should break no additional tests.
The last-merged revision is going in a 'last_merge' property on '.' (the
branch directory.) Arbitrarily chosen, really; if there's a BCP for this, I
couldn't find it, but we can easily change it afterwards ;)
Fix the problems in this test. Boy this is a painful thing to debug --
it's fundamentally unmaintainable. Should we throw away pyclbr, or rewrite
it using the AST?
Fix the expected output file; new classes just behave differently...
(There are some other problems with test_class.py that aren't as
easily fixed. :-( )
Thomas Wouters [Sat, 15 Apr 2006 09:19:16 +0000 (09:19 +0000)]
Make test_class work (but still fail) even though class.__dict__ is now a
'dictproxy' (which is a read-only non-dict mapping type that can't be passed
to exec.)
The failures the test finds are behavioural differences between old- and
new-style classes that may or may not be intended.
Thomas Wouters [Sat, 15 Apr 2006 09:15:11 +0000 (09:15 +0000)]
Fix tests for PyArg_Parse*; The PyArg_Parse functions no longer (noisily)
convert float arguments to integer-taking format characters, so fix the test
to expect the failure.
Thomas Wouters [Sat, 15 Apr 2006 09:10:43 +0000 (09:10 +0000)]
Fix the superficial augmented-assignment tests to deal with true division.
Add (equally superficial) >>=/<<= test in the process. Relies on floats that
should be extremely close to the int '6' printing as '6.0', but I believe
that's a valid assumption ;P
Thomas Wouters [Sat, 15 Apr 2006 09:07:20 +0000 (09:07 +0000)]
Fix tests that were trying to make iteration blow up, on broken iterators.
Since the broken iterators are now new-style classes, iter() was able to do
the valid-iterator check sooner (on instantiation instead of on first call),
making the tests blow up sooner than expected.
Thomas Wouters [Sat, 15 Apr 2006 09:03:16 +0000 (09:03 +0000)]
- Fix doctest results to account for classes being new-style, and thus
printing differently.
- Fix doctest for classic-class behaviour, make it test new-style behaviour
on an implicitly-new-style class instead.
Thomas Wouters [Fri, 14 Apr 2006 11:33:28 +0000 (11:33 +0000)]
Make 'python -tt' the default, meaning Python won't allow mixing tabs and
spaces for indentation. Adds a '-ttt' option to turn the errors back into
warnings; I'm not yet sure whether that's desireable for Py3K.
Also remove the magic for setting the size of tabs based on emacs/vim-style
comments. Python now always considers tabstops to be every-8-spaces.
Neal Norwitz [Fri, 24 Mar 2006 07:38:37 +0000 (07:38 +0000)]
Use *absolute* import now that it is required. (Should this go into 2.5? Hopefully not the bogus comment about using relative imports. That was just to see if anyone was paying attention.)
Neal Norwitz [Wed, 22 Mar 2006 09:20:30 +0000 (09:20 +0000)]
Get doctest to pass. The problem was int/int -> float now. There
were some cases where an int was assumed.
Also had to change the string of the exception when dividing and int by zero.
Not sure what the best error message should be. Currently
5 / 0 yields the message: ZeroDivisionError: float division
That isn't entirely correct. But I'm not sure what else to do.
Guido van Rossum [Wed, 15 Mar 2006 04:58:47 +0000 (04:58 +0000)]
Checkpoint. 218 tests are okay; 53 are failing. Done so far:
- all classes are new-style (but ripping out classobject.[ch] isn't done)
- int/int -> float
- all exceptions must derive from BaseException
- absolute import
- 'as' and 'with' are keywords
Thomas Heller [Tue, 14 Mar 2006 19:53:09 +0000 (19:53 +0000)]
Integrate patch from Neal Norwitz. He writes:
"""
The attached patch fixes all the ctypes tests so they pass on amd64.
It also fixes several warnings. I'm not sure what else to do with the
patch. Let me know how you want to handle these in the future.
I'm not sure the patch is 100% correct. You will need to decide what
can be 64 bits and what can't. I believe
sq_{item,slice,ass_item,ass_slice} all need to use Py_ssize_t. The
types in ctypes.h may not require all the changes I made. I don't
know how you want to support older version, so I unconditionally
changed the types to Py_ssize_t.
"""
The patch is also in the ctypes SVN repository now, after small
changes to add compatibility with older Python versions.
Neal Norwitz [Tue, 14 Mar 2006 06:02:16 +0000 (06:02 +0000)]
Fix and test (manually w/xx module) passing NULLs to PyObject_Str() and
PyObject_Unicode(). This problem was originally reported from Coverity
and addresses mail on python-dev "checkin r43015".
This inlines the conversion of the string to unicode and cleans
up/simplifies some code at the end of the PyObject_Unicode().
We really need a complete C API test module for all public APIs
and passing good and bad parameter values.
Thomas Heller [Mon, 13 Mar 2006 07:33:38 +0000 (07:33 +0000)]
Remove the slightly broken test_leaks.py.
Change test_functions.py so that it can be run multiple time without
failing: Assign a restype to the function in test_intresult, and move
the definition of class POINT to module level so that no new class is
created each time the test is run.