[ZODB-Dev] Progress report: porting persistent, BTrees to Python3

Tres Seaver tseaver at palladion.com
Sat Dec 15 00:52:08 UTC 2012


-----BEGIN PGP SIGNED MESSAGE-----
Hash: SHA1

On 12/13/2012 09:40 PM, Tres Seaver wrote:
> I have gotten the trunk of persistent to build an test persistent's 
> extension modules under Python 3.2.  There is a segfault under Python
> 3.3 which looks to be an actual Python bug:
> 
> http://bugs.python.org/issue16676
> 
> I will make a 4.0.5 release once I figure out what to do about that
> test under 3.3 (maybe I'll just skip it).

I fixed the remainig issues in persistent and released 4.0.5 today:  its
tests properly exercise the C extensions Under Python 3.2 / 3.3.

> On the BTrees front:  I have the extension modules compiling under 
> Python3 (the 'py3k' branch), but didn't read Lennart's excellent
> guide closely enough to do the new module initialization dance
> correctly.  I plan to fix that tomoorow and hope to have the C
> versions of the trees passing all the same tests as the pure-python
> implementations.  Once they pass, I will merge that branch to the
> trunk and look to cut a new release.
> 
> Both packages are set up to test against all supported Python
> versions using tox:  at this point, that includes 2.6, 2.7, PyPy, 3.2,
> and 3.3. The tox config also builds Sphinx docs and exercises the
> doctest snippets, as well as running coverage (at this point only
> under Python2).

I'm down to one test failure (out of 3600+) under Py3k:  the test that
inserting an out-of-bounds long long key into an L*BTree.  On Python 3.2,
the assertion fails::

======================================================================
FAIL: test64 (BTrees.tests.testBTrees.FamilyTest)
- ----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/tseaver/projects/Zope/ZODB/BTrees-py3k/BTrees/tests/testBTrees.py", line
481, in test64
    self.assertRaises(ValueError, s.insert, BTrees.family64.maxint + 1)
AssertionError: ValueError not raised by insert

On Python 3.3, the test fails with an OverflowError::

======================================================================
ERROR: test64 (BTrees.tests.testBTrees.FamilyTest)
- ----------------------------------------------------------------------
Traceback (most recent call last):
  File
"/home/tseaver/projects/Zope/ZODB/BTrees-py3k/BTrees/tests/testBTrees.py", line
481, in test64
    self.assertRaises(ValueError, s.insert, BTrees.family64.maxint + 1)
  File "/opt/Python-3.3.0/lib/python3.3/unittest/case.py", line 571, in
assertRaises
    return context.handle('assertRaises', callableObj, args, kwargs)
  File "/opt/Python-3.3.0/lib/python3.3/unittest/case.py", line 135, in
handle
    callable_obj(*args, **kwargs)
  File "/opt/Python-3.3.0/lib/python3.3/unittest/case.py", line 153, in
__exit__
    self.obj_name))
OverflowError: Python int too large to convert to C long

The latter one is easy, I think:  we could just have the test assert
either ValueError *or* OverflowError.  Figuring out why the insert
doesn't raise at all under 3.2 is too hard for my bleary eyes to tackle
tonight (I've already reverted one failed stab at it).

One good thing:  the tests under Py3k now take about thes ame time as the
CPython 2.x ones (just over a minute on my box):  that is down from over
five minutes before getting the C extensions working.  The PyPy tests,
running without extensions, take about three minutes.

Onward-and-upward'ly,


Tres.
- -- 
===================================================================
Tres Seaver          +1 540-429-0999          tseaver at palladion.com
Palladion Software   "Excellence by Design"    http://palladion.com
-----BEGIN PGP SIGNATURE-----
Version: GnuPG v1.4.11 (GNU/Linux)
Comment: Using GnuPG with undefined - http://www.enigmail.net/

iEYEARECAAYFAlDLybgACgkQ+gerLs4ltQ6VSwCgmwLLIEOArUzSsOLbMWnRhq2Q
a04AoIWVjuWqkYrSOo/3ukNL7rAiKskY
=yLOx
-----END PGP SIGNATURE-----



More information about the ZODB-Dev mailing list