[ZODB-Dev] Python 3 support for relstorage

Antti Haapala antti.haapala at anttipatterns.com
Sun Sep 7 20:05:14 CEST 2014


Hi all,

Recently I wanted to have relstorage on Python 3, so I made a fork at
http://github.com/ztane/relstorage, and tried to make it polyglot with
minimal changes. I did not even use six as I didn't want any extra imports
(I just realized later that ZODB was using it), just wrote a single module
compat.py with all the differences in invocations (mostly). Now, with
PostgreSQL setup.py test passes 256/256 on Python 2.7 and 255/255 on Python
3.4.

There is the one test checkNonASCIITransactionMetadata
doing setUser with non-ascii characters that did not seem to be supported
in transaction and ZODB themselves so I dropped it out for PY3.

I am not an expert on relstorage (never used it before), so I am not sure
how buggy it is - I needed to change the *tests* themselves a lot; also,
mysql-python is not available for Python 3, I do not care enough about
MySQL to install it nor to make it use another module, and I can't afford
Oracle ;).

I wrote the code to work on Python <2.6 also (it avoids `except Cls as e`
for example), however I do not have Python <2.6 installed either.

Comments?

-- 
Antti Haapala
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.zope.org/pipermail/zodb-dev/attachments/20140907/63a00aa8/attachment.html>


More information about the ZODB-Dev mailing list