diff --git a/README b/README index d36779a..9a655e8 100644 --- a/README +++ b/README @@ -1,10 +1,12 @@ +:: WARNING :: +This driver is no longer supported or recommended. See https://github.com/zodb/relstorage/issues/264 + :: Description :: -A fast MySQL driver written in pure C/C++ for Python. +A fast MySQL driver written in pure C/C++ for Python. Compatible with gevent through monkey patching :: Requirements :: -Requires Python (http://www.python.org) +Requires Python (http://www.python.org) :: Installation :: python setup.py build install - diff --git a/python/umysql.c b/python/umysql.c index 2564e97..c568ed3 100644 --- a/python/umysql.c +++ b/python/umysql.c @@ -769,11 +769,12 @@ PyObject *Connection_isConnected(Connection *self, PyObject *args) Py_RETURN_FALSE; } +#ifndef PYPY_VERSION PyObject *PyUnicode_EncodeCP1250Helper(const Py_UNICODE *data, Py_ssize_t length, const char *errors) { return PyUnicode_Encode (data, length, "cp1250", errors); } - +#endif PyObject *HandleError(Connection *self, const char *funcName) { @@ -878,8 +879,12 @@ PyObject *Connection_connect(Connection *self, PyObject *args) else if (strcmp (pstrCharset, "cp1250") == 0) { +#ifndef PYPY_VERSION self->charset = MCS_cp1250_general_ci; self->PFN_PyUnicode_Encode = PyUnicode_EncodeCP1250Helper; +#else + return PyErr_Format (PyExc_ValueError, "Unsupported character set '%s' specified", pstrCharset); +#endif } else if (strcmp (pstrCharset, "utf8mb4") == 0) @@ -1093,7 +1098,7 @@ PyObject *EscapeQueryArguments(Connection *self, PyObject *inQuery, PyObject *it { /* FIXME: Allocate a PyString and resize it just like the Python code does it */ - obuffer = (char *) PyObject_Malloc(cbOutQuery); + obuffer = (char *) PyMem_Malloc(cbOutQuery); heap = 1; } else @@ -1124,7 +1129,7 @@ PyObject *EscapeQueryArguments(Connection *self, PyObject *inQuery, PyObject *it if (*iptr != 's' && *iptr != '%') { Py_DECREF(iterator); - if (heap) PyObject_Free(obuffer); + if (heap) PyMem_Free(obuffer); return PyErr_Format (PyExc_ValueError, "Found character %c expected %%", *iptr); } diff --git a/setup.py b/setup.py index 81383bc..58b6918 100644 --- a/setup.py +++ b/setup.py @@ -68,6 +68,8 @@ Programming Language :: Python Topic :: Database Topic :: Software Development :: Libraries :: Python Modules +Programming Language :: Python :: Implementation :: CPython +Programming Language :: Python :: Implementation :: PyPy """.splitlines())) """ @@ -75,13 +77,13 @@ shutil.rmtree("./build") except(OSError): pass -""" - +""" + libs = [] if sys.platform != "win32": libs.append("stdc++") - + if sys.platform == "win32": libs.append("ws2_32") @@ -92,16 +94,16 @@ library_dirs = [], libraries=libs, define_macros=[('WIN32_LEAN_AND_MEAN', None)]) - + setup (name = 'umysql', - version = "2.61", + version = "2.62.dev0", description = "Ultra fast MySQL driver for Python", ext_modules = [module1], author="Jonas Tarnstrom", author_email="jonas.tarnstrom@esn.me", download_url="http://github.com/esnme/ultramysql", license="BSD License", - platforms=['any'], + platforms=['any'], url="http://www.esn.me", classifiers=CLASSIFIERS, - ) + )