Hello community, here is the log from the commit of package python-mysqlclient for openSUSE:Factory checked in at 2019-08-23 11:02:39 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Comparing /work/SRC/openSUSE:Factory/python-mysqlclient (Old) and /work/SRC/openSUSE:Factory/.python-mysqlclient.new.7948 (New) ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
Package is "python-mysqlclient" Fri Aug 23 11:02:39 2019 rev:5 rq:723831 version:1.4.4 Changes: -------- --- /work/SRC/openSUSE:Factory/python-mysqlclient/python-mysqlclient.changes 2019-06-13 22:37:49.556293987 +0200 +++ /work/SRC/openSUSE:Factory/.python-mysqlclient.new.7948/python-mysqlclient.changes 2019-08-23 11:02:40.506522415 +0200 @@ -1,0 +2,17 @@ +Thu Aug 15 19:25:35 UTC 2019 - Alexei Podvalsky <[email protected]> + +- Update to 1.4.4: + * charset option is passed to mysql_options(mysql, MYSQL_SET_CHARSET_NAME, + charset) before mysql_real_connect is called. This avoid extra + SET NAMES <charset> query when creating connection. +- Change in 1.4.3: + * --static build supports libmariadbclient.a + * Try mariadb_config when mysql_config is not found + * Fixed warning happend in Python 3.8 (#359) + * Fixed from MySQLdb import *, while I don't recommend it. (#369) + * Fixed SEGV MySQLdb.escape_string("1") when libmariadb is used and + no connection is created. (#367) + * Fixed many circular references are created in Cursor.executemany(). +- Add python3-attrs to build + +------------------------------------------------------------------- Old: ---- mysqlclient-1.4.2.tar.gz New: ---- mysqlclient-1.4.4.tar.gz ++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++ Other differences: ------------------ ++++++ python-mysqlclient.spec ++++++ --- /var/tmp/diff_new_pack.06ioTc/_old 2019-08-23 11:02:41.002522335 +0200 +++ /var/tmp/diff_new_pack.06ioTc/_new 2019-08-23 11:02:41.006522334 +0200 @@ -19,7 +19,7 @@ %{?!python_module:%define python_module() python-%{**} python3-%{**}} %define oldpython python Name: python-mysqlclient -Version: 1.4.2 +Version: 1.4.4 Release: 0 Summary: Python interface to MySQL License: GPL-2.0-or-later @@ -28,6 +28,7 @@ Source: https://files.pythonhosted.org/packages/source/m/mysqlclient/mysqlclient-%{version}.tar.gz BuildRequires: %{python_module devel} BuildRequires: %{python_module setuptools} +BuildRequires: python3-attrs BuildRequires: fdupes BuildRequires: libmysqlclient-devel BuildRequires: python-rpm-macros ++++++ mysqlclient-1.4.2.tar.gz -> mysqlclient-1.4.4.tar.gz ++++++ diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/HISTORY.rst new/mysqlclient-1.4.4/HISTORY.rst --- old/mysqlclient-1.4.2/HISTORY.rst 2019-02-08 13:23:27.000000000 +0100 +++ new/mysqlclient-1.4.4/HISTORY.rst 2019-08-11 17:34:01.000000000 +0200 @@ -1,4 +1,30 @@ ====================== + What's new in 1.4.4 +====================== + +Release: 2019-08-12 + +* ``charset`` option is passed to ``mysql_options(mysql, MYSQL_SET_CHARSET_NAME, charset)`` + before ``mysql_real_connect`` is called. + This avoid extra ``SET NAMES <charset>`` query when creating connection. + + +====================== + What's new in 1.4.3 +====================== + +Release: 2019-08-09 + +* ``--static`` build supports ``libmariadbclient.a`` +* Try ``mariadb_config`` when ``mysql_config`` is not found +* Fixed warning happend in Python 3.8 (#359) +* Fixed ``from MySQLdb import *``, while I don't recommend it. (#369) +* Fixed SEGV ``MySQLdb.escape_string("1")`` when libmariadb is used and + no connection is created. (#367) +* Fixed many circular references are created in ``Cursor.executemany()``. (#375) + + +====================== What's new in 1.4.2 ====================== @@ -73,8 +99,9 @@ * Add ``Connection._get_native_connection`` for XTA project (#269) -* Fix SEGV on MariaDB Connector/C when ``Connection.close()`` is called - for closed connection. (#270, #272, #276) +* Fix SEGV on MariaDB Connector/C when some methods of ``Connection`` + objects are called after ``Connection.close()`` is called. (#270, #272, #276) + See https://jira.mariadb.org/browse/CONC-289 * Fix ``Connection.client_flag`` (#266) diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/MySQLdb/__init__.py new/mysqlclient-1.4.4/MySQLdb/__init__.py --- old/mysqlclient-1.4.2/MySQLdb/__init__.py 2019-01-17 13:30:38.000000000 +0100 +++ new/mysqlclient-1.4.4/MySQLdb/__init__.py 2019-07-18 10:40:54.000000000 +0200 @@ -89,7 +89,7 @@ 'Date', 'Time', 'Timestamp', 'DateFromTicks', 'TimeFromTicks', 'TimestampFromTicks', 'DataError', 'DatabaseError', 'Error', 'FIELD_TYPE', 'IntegrityError', 'InterfaceError', 'InternalError', - 'MySQLError', 'NULL', 'NUMBER', 'NotSupportedError', 'DBAPISet', + 'MySQLError', 'NUMBER', 'NotSupportedError', 'DBAPISet', 'OperationalError', 'ProgrammingError', 'ROWID', 'STRING', 'TIME', 'TIMESTAMP', 'Warning', 'apilevel', 'connect', 'connections', 'constants', 'converters', 'cursors', 'debug', 'escape', diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/MySQLdb/_mysql.c new/mysqlclient-1.4.4/MySQLdb/_mysql.c --- old/mysqlclient-1.4.2/MySQLdb/_mysql.c 2019-02-07 10:38:02.000000000 +0100 +++ new/mysqlclient-1.4.4/MySQLdb/_mysql.c 2019-08-11 17:17:34.000000000 +0200 @@ -34,6 +34,7 @@ #define my_bool _Bool #endif +#define PY_SSIZE_T_CLEAN 1 #include "Python.h" #if PY_MAJOR_VERSION >= 3 #define IS_PY3K @@ -396,7 +397,7 @@ "read_default_file", "read_default_group", "client_flag", "ssl", "local_infile", - "read_timeout", "write_timeout", + "read_timeout", "write_timeout", "charset", NULL } ; int connect_timeout = 0; int read_timeout = 0; @@ -404,13 +405,14 @@ int compress = -1, named_pipe = -1, local_infile = -1; char *init_command=NULL, *read_default_file=NULL, - *read_default_group=NULL; + *read_default_group=NULL, + *charset=NULL; self->converter = NULL; self->open = 0; if (!PyArg_ParseTupleAndKeywords(args, kwargs, - "|ssssisOiiisssiOiii:connect", + "|ssssisOiiisssiOiiis:connect", kwlist, &host, &user, &passwd, &db, &port, &unix_socket, &conv, @@ -421,7 +423,8 @@ &client_flag, &ssl, &local_infile, &read_timeout, - &write_timeout + &write_timeout, + &charset )) return -1; @@ -444,8 +447,12 @@ _stringsuck(cipher, value, ssl); } - Py_BEGIN_ALLOW_THREADS ; conn = mysql_init(&(self->connection)); + if (!conn) { + PyErr_SetNone(PyExc_MemoryError); + return -1; + } + Py_BEGIN_ALLOW_THREADS ; self->open = 1; if (connect_timeout) { unsigned int timeout = connect_timeout; @@ -481,6 +488,9 @@ if (ssl) { mysql_ssl_set(&(self->connection), key, cert, ca, capath, cipher); } + if (charset) { + mysql_options(&(self->connection), MYSQL_SET_CHARSET_NAME, charset); + } conn = mysql_real_connect(&(self->connection), host, user, passwd, db, port, unix_socket, client_flag); @@ -497,7 +507,6 @@ if (!conn) { _mysql_Exception(self); - self->open = 0; return -1; } @@ -732,7 +741,7 @@ } static char _mysql_ConnectionObject_rollback__doc__[] = -"Rolls backs the current transaction\n\ +"Rolls back the current transaction\n\ "; static PyObject * _mysql_ConnectionObject_rollback( @@ -879,7 +888,8 @@ { PyObject *str; char *in, *out; - int len, size; + int len; + Py_ssize_t size; if (!PyArg_ParseTuple(args, "s#:escape_string", &in, &size)) return NULL; str = PyBytes_FromStringAndSize((char *) NULL, size*2+1); if (!str) return PyErr_NoMemory(); @@ -1099,7 +1109,7 @@ _mysql_field_to_python( PyObject *converter, const char *rowitem, - unsigned long length, + Py_ssize_t length, MYSQL_FIELD *field, const char *encoding) { @@ -1147,16 +1157,17 @@ #endif // Call converter with bytes binary = 1; + break; default: // e.g. FIELD_TYPE_DATETIME, etc. // Call converter with unicode string binary = 0; } return PyObject_CallFunction(converter, binary ? "y#" : "s#", - rowitem, (int)length); + rowitem, (Py_ssize_t)length); #else return PyObject_CallFunction(converter, - "s#", rowitem, (int)length); + "s#", rowitem, (Py_ssize_t)length); #endif } @@ -1748,7 +1759,8 @@ PyObject *args) { char *query; - int len, r; + Py_ssize_t len; + int r; if (!PyArg_ParseTuple(args, "s#:query", &query, &len)) return NULL; check_connection(self); @@ -1770,7 +1782,8 @@ PyObject *args) { char *query; - int len, r; + Py_ssize_t len; + int r; MYSQL *mysql = &(self->connection); if (!PyArg_ParseTuple(args, "s#:query", &query, &len)) return NULL; check_connection(self); @@ -2635,6 +2648,15 @@ { PyObject *dict, *module, *emod, *edict; + if (mysql_library_init(0, NULL, NULL)) { + PyErr_SetString(PyExc_ImportError, "_mysql: mysql_library_init failed"); +#ifdef IS_PY3K + return NULL; +#else + return; +#endif + } + #ifdef IS_PY3K if (PyType_Ready(&_mysql_ConnectionObject_Type) < 0) return NULL; diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/MySQLdb/connections.py new/mysqlclient-1.4.4/MySQLdb/connections.py --- old/mysqlclient-1.4.2/MySQLdb/connections.py 2019-02-07 10:38:07.000000000 +0100 +++ new/mysqlclient-1.4.4/MySQLdb/connections.py 2019-08-11 17:17:34.000000000 +0200 @@ -73,21 +73,23 @@ :param bool use_unicode: If True, text-like columns are returned as unicode objects - using the connection's character set. Otherwise, text-like - columns are returned as strings. columns are returned as - normal strings. Unicode objects will always be encoded to - the connection's character set regardless of this setting. - Default to False on Python 2 and True on Python 3. + using the connection's character set. Otherwise, text-like + columns are returned as bytes. Unicode objects will always + be encoded to the connection's character set regardless of + this setting. + Default to False on Python 2 and True on Python 3 + so that you can always get python `str` object by default. :param str charset: If supplied, the connection character set will be changed - to this character set (MySQL-4.1 and newer). This implies - use_unicode=True. + to this character set. + On Python 2, this option changes default value of `use_unicode` + option from False to True. :param str sql_mode: If supplied, the session SQL mode will be changed to this - setting (MySQL-4.1 and newer). For more details and legal - values, see the MySQL documentation. + setting. + For more details and legal values, see the MySQL documentation. :param int client_flag: flags to use or 0 (see MySQL docs or constants/CLIENTS.py) @@ -138,7 +140,7 @@ kwargs2['conv'] = conv2 cursorclass = kwargs2.pop('cursorclass', self.default_cursor) - charset = kwargs2.pop('charset', '') + charset = kwargs2.get('charset', '') if charset or not PY2: use_unicode = True diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/MySQLdb/cursors.py new/mysqlclient-1.4.4/MySQLdb/cursors.py --- old/mysqlclient-1.4.2/MySQLdb/cursors.py 2019-02-07 10:38:07.000000000 +0100 +++ new/mysqlclient-1.4.4/MySQLdb/cursors.py 2019-08-08 11:58:35.000000000 +0200 @@ -110,14 +110,17 @@ return x if isinstance(args, (tuple, list)): - return tuple(literal(ensure_bytes(arg)) for arg in args) + ret = tuple(literal(ensure_bytes(arg)) for arg in args) elif isinstance(args, dict): - return {ensure_bytes(key): literal(ensure_bytes(val)) - for (key, val) in args.items()} + ret = {ensure_bytes(key): literal(ensure_bytes(val)) + for (key, val) in args.items()} else: # If it's not a dictionary let's try escaping it anyways. # Worst case it will throw a Value error - return literal(ensure_bytes(args)) + ret = literal(ensure_bytes(args)) + + ensure_bytes = None # break circular reference + return ret def _check_executed(self): if not self._executed: @@ -471,7 +474,7 @@ class DictCursor(CursorStoreResultMixIn, CursorDictRowsMixIn, BaseCursor): - """This is a Cursor class that returns rows as dictionaries and + """This is a Cursor class that returns rows as dictionaries and stores the result set in the client.""" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/MySQLdb/release.py new/mysqlclient-1.4.4/MySQLdb/release.py --- old/mysqlclient-1.4.2/MySQLdb/release.py 2019-02-08 13:25:26.000000000 +0100 +++ new/mysqlclient-1.4.4/MySQLdb/release.py 2019-08-11 17:36:07.000000000 +0200 @@ -1,4 +1,4 @@ __author__ = "Inada Naoki <[email protected]>" -version_info = (1,4,2,'final',0) -__version__ = "1.4.2" +version_info = (1,4,4,'final',0) +__version__ = "1.4.4" diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/PKG-INFO new/mysqlclient-1.4.4/PKG-INFO --- old/mysqlclient-1.4.2/PKG-INFO 2019-02-08 13:25:26.000000000 +0100 +++ new/mysqlclient-1.4.4/PKG-INFO 2019-08-11 17:36:07.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mysqlclient -Version: 1.4.2 +Version: 1.4.4 Summary: Python interface to MySQL Home-page: https://github.com/PyMySQL/mysqlclient-python Author: Inada Naoki @@ -97,6 +97,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Database Classifier: Topic :: Database :: Database Engines/Servers Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/doc/user_guide.rst new/mysqlclient-1.4.4/doc/user_guide.rst --- old/mysqlclient-1.4.2/doc/user_guide.rst 2019-01-17 13:30:38.000000000 +0100 +++ new/mysqlclient-1.4.4/doc/user_guide.rst 2019-07-18 10:40:54.000000000 +0200 @@ -8,7 +8,7 @@ Introduction ------------ -MySQLdb is a interface to the popular MySQL +MySQLdb is an interface to the popular MySQL database server that provides the Python database API. Installation diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/metadata.cfg new/mysqlclient-1.4.4/metadata.cfg --- old/mysqlclient-1.4.2/metadata.cfg 2019-02-08 13:23:27.000000000 +0100 +++ new/mysqlclient-1.4.4/metadata.cfg 2019-08-11 17:35:01.000000000 +0200 @@ -1,6 +1,6 @@ [metadata] -version: 1.4.2 -version_info: (1,4,2,'final',0) +version: 1.4.4 +version_info: (1,4,4,'final',0) description: Python interface to MySQL author: Inada Naoki author_email: [email protected] @@ -25,6 +25,7 @@ Programming Language :: Python :: 3.5 Programming Language :: Python :: 3.6 Programming Language :: Python :: 3.7 + Programming Language :: Python :: 3.8 Topic :: Database Topic :: Database :: Database Engines/Servers py_modules: diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/mysqlclient.egg-info/PKG-INFO new/mysqlclient-1.4.4/mysqlclient.egg-info/PKG-INFO --- old/mysqlclient-1.4.2/mysqlclient.egg-info/PKG-INFO 2019-02-08 13:25:26.000000000 +0100 +++ new/mysqlclient-1.4.4/mysqlclient.egg-info/PKG-INFO 2019-08-11 17:36:07.000000000 +0200 @@ -1,6 +1,6 @@ Metadata-Version: 2.1 Name: mysqlclient -Version: 1.4.2 +Version: 1.4.4 Summary: Python interface to MySQL Home-page: https://github.com/PyMySQL/mysqlclient-python Author: Inada Naoki @@ -97,6 +97,7 @@ Classifier: Programming Language :: Python :: 3.5 Classifier: Programming Language :: Python :: 3.6 Classifier: Programming Language :: Python :: 3.7 +Classifier: Programming Language :: Python :: 3.8 Classifier: Topic :: Database Classifier: Topic :: Database :: Database Engines/Servers Description-Content-Type: text/markdown diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/setup_posix.py new/mysqlclient-1.4.4/setup_posix.py --- old/mysqlclient-1.4.2/setup_posix.py 2018-12-05 10:33:59.000000000 +0100 +++ new/mysqlclient-1.4.4/setup_posix.py 2019-08-08 11:58:35.000000000 +0200 @@ -37,6 +37,16 @@ if 'mysql_config' in options: _mysql_config_path = options['mysql_config'] + else: + try: + mysql_config('version') + except EnvironmentError: + # try mariadb_config + _mysql_config_path = "mariadb_config" + try: + mysql_config('version') + except EnvironmentError: + _mysql_config_path = "mysql_config" extra_objects = [] static = enabled(options, 'static') @@ -69,7 +79,7 @@ # properly handle mysql client libraries that are not called libmysqlclient client = None CLIENT_LIST = ['mysqlclient', 'mysqlclient_r', 'mysqld', 'mariadb', - 'perconaserverclient', 'perconaserverclient_r'] + 'mariadbclient', 'perconaserverclient', 'perconaserverclient_r'] for c in CLIENT_LIST: if c in libraries: client = c diff -urN '--exclude=CVS' '--exclude=.cvsignore' '--exclude=.svn' '--exclude=.svnignore' old/mysqlclient-1.4.2/tests/test_MySQLdb_nonstandard.py new/mysqlclient-1.4.4/tests/test_MySQLdb_nonstandard.py --- old/mysqlclient-1.4.2/tests/test_MySQLdb_nonstandard.py 2019-01-17 13:30:38.000000000 +0100 +++ new/mysqlclient-1.4.4/tests/test_MySQLdb_nonstandard.py 2019-07-18 10:40:54.000000000 +0200 @@ -83,7 +83,7 @@ def test_server_info(self): self.assertTrue(isinstance(self.conn.get_server_info(), str), - "Should return an str.") + "Should return a string.") def test_client_flag(self): conn = connection_factory(
