Closed coyotemarin closed 8 years ago
We could also leave it up to sqlalchemy
to fix this (Issue #2).
FWIW if you use https://github.com/quora/mysql-ctypes then doloop will be compatible with PyPy; it's also supposed to have a compatible API. Or you could just make it configurable, I don't think there's a reason why it has to be hardcoded to one thing or another.
doloop
currently only uses MySQLdb
for error handling; otherwise, it just expects a connection object of some sort.
Is there a portable way to handle exceptions from the various database interfaces?
Actually, to answer my own question, it looks like mysql-ctypes
imports exceptions from MySQLdb
.
I should just do a survey of different MySQL implementations to see how they raise OperationalError
s. The name OperationalError
is specified in PEP249, and there can't be too many variations on how the error code and message are stored in the exception.
Tests have been in unittest2
for some time now. So making doloop
a Python 2.6+ library should be do-able.
Here are some suggested MySQL libraries to use with Python 3.x.
(Also note that doloop
has been agnostic as to MySQL library for some time.)
Yelp is moving off Python 2.5, so it should be feasible for
doloop
to be a Python 2.6+ library that also works on Python 3.