Description:
During the build process, if the --with-mysql-api option is given, C/Py checks the MySQL version number, and fails if the final version component has nonnumeric characters.
How to repeat:
My installed version of MySQL is "5.7.6-m16"
% python setup.py build_ext --with-mysql-capi=/usr/local/mysql
running build_ext
Traceback (most recent call last):
File "setup.py", line 64, in <module>
ext_modules=setupinfo.extensions,
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/core.py", line 151, in setup
dist.run_commands()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/opt/local/Library/Frameworks/Python.framework/Versions/2.7/lib/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/src/extern/MySQL/mysql-git/connector-python/lib/cpy_distutils.py", line 327, in finalize_options
self._finalize_connector_c(self.with_mysql_capi)
File "/src/extern/MySQL/mysql-git/connector-python/lib/cpy_distutils.py", line 289, in _finalize_connector_c
myc_info = get_mysql_config_info(mysql_config)
File "/src/extern/MySQL/mysql-git/connector-python/lib/cpy_distutils.py", line 147, in get_mysql_config_info
info['version'] = tuple([int(v) for v in info['version'].split('.')[0:3]])
ValueError: invalid literal for int() with base 10: '6-m16'
If I point --with-mysql-capi at my 5.6.24 installation, it works, presumably because that version number has no nonnumeric suffix.
Suggested fix:
Version splitter needs to be a little smarter?