Bug #87578 IndexError: list index out of range --with-mysql-capi=mysql_config
Description:
$ python setup.py install --with-protobuf-include-dir=/usr/include/google/protobuf --with-protobuf-lib-dir=/usr/lib/x86_64-linux-gnu --with-protoc=/usr/bin/protoc --with-mysql-capi=/home/shahriyar.rzaev/MYROCKS/PS250817-percona-server-5.7.19-17-linux-x86_64-debug/bin/mysql_config
running install
Installing MySQL C Extension
running build
running build_py
running build_ext
# Python architecture: 64-bit
# Python ARCH_64BIT: True
# Looking mysqlclient_lib at path: /home/shahriyar.rzaev/MYROCKS/PS250817-percona-server-5.7.19-17-linux-x86_64-debug/lib/mysql/libperconaserverclient*
Traceback (most recent call last):
File "setup.py", line 64, in <module>
ext_modules=setupinfo.extensions,
File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup
dist.run_commands()
File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands
self.run_command(cmd)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 822, in run
install.run(self)
File "/usr/lib64/python2.7/distutils/command/install.py", line 563, in run
self.run_command('build')
File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command
cmd_obj.run()
File "/usr/lib64/python2.7/distutils/command/build.py", line 127, in run
self.run_command(cmd_name)
File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command
self.distribution.run_command(command)
File "/usr/lib64/python2.7/distutils/dist.py", line 971, in run_command
cmd_obj.ensure_finalized()
File "/usr/lib64/python2.7/distutils/cmd.py", line 109, in ensure_finalized
self.finalize_options()
File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 435, in finalize_options
self._finalize_connector_c(self.with_mysql_capi)
File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 383, in _finalize_connector_c
myc_info = get_mysql_config_info(mysql_config)
File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 232, in get_mysql_config_info
log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1]))
IndexError: list index out of range
How to repeat:
Looking at failed code line:
File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 232, in get_mysql_config_info
mysqlclient_libs = []
for filepath in libs:
_, filename = os.path.split(filepath)
log.debug("# filename {0}".format(filename))
if filename.startswith('libmysqlclient') and \
not os.path.islink(filepath) and \
'_r' not in filename and \
'.a' not in filename:
mysqlclient_libs.append(filepath)
mysqlclient_libs.sort()
stdout = None
try:
log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1]))
It seems to be the mysqlclient_libs list is empty due to filename.startswith('libmysqlclient') check.
So maybe it will be great, not to limit clients to mysql or to check if len(mysqlclient_libs) > 0 prior accessing index.
Portions of this website are copyright © 2001, 2002 The PHP Group
Page generated in 0.041 sec. using MySQL 8.4.7-u6-cloud
Timestamp references displayed by the system are UTC.
Content reproduced on this site is the property of the
respective copyright holders.
It is not reviewed in advance
by Oracle and does not necessarily represent the opinion of
Oracle or any other party.
Description: $ python setup.py install --with-protobuf-include-dir=/usr/include/google/protobuf --with-protobuf-lib-dir=/usr/lib/x86_64-linux-gnu --with-protoc=/usr/bin/protoc --with-mysql-capi=/home/shahriyar.rzaev/MYROCKS/PS250817-percona-server-5.7.19-17-linux-x86_64-debug/bin/mysql_config running install Installing MySQL C Extension running build running build_py running build_ext # Python architecture: 64-bit # Python ARCH_64BIT: True # Looking mysqlclient_lib at path: /home/shahriyar.rzaev/MYROCKS/PS250817-percona-server-5.7.19-17-linux-x86_64-debug/lib/mysql/libperconaserverclient* Traceback (most recent call last): File "setup.py", line 64, in <module> ext_modules=setupinfo.extensions, File "/usr/lib64/python2.7/distutils/core.py", line 152, in setup dist.run_commands() File "/usr/lib64/python2.7/distutils/dist.py", line 953, in run_commands self.run_command(cmd) File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 822, in run install.run(self) File "/usr/lib64/python2.7/distutils/command/install.py", line 563, in run self.run_command('build') File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.7/distutils/dist.py", line 972, in run_command cmd_obj.run() File "/usr/lib64/python2.7/distutils/command/build.py", line 127, in run self.run_command(cmd_name) File "/usr/lib64/python2.7/distutils/cmd.py", line 326, in run_command self.distribution.run_command(command) File "/usr/lib64/python2.7/distutils/dist.py", line 971, in run_command cmd_obj.ensure_finalized() File "/usr/lib64/python2.7/distutils/cmd.py", line 109, in ensure_finalized self.finalize_options() File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 435, in finalize_options self._finalize_connector_c(self.with_mysql_capi) File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 383, in _finalize_connector_c myc_info = get_mysql_config_info(mysql_config) File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 232, in get_mysql_config_info log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1])) IndexError: list index out of range How to repeat: Looking at failed code line: File "/home/shahriyar.rzaev/mysql-connector-python/lib/cpy_distutils.py", line 232, in get_mysql_config_info mysqlclient_libs = [] for filepath in libs: _, filename = os.path.split(filepath) log.debug("# filename {0}".format(filename)) if filename.startswith('libmysqlclient') and \ not os.path.islink(filepath) and \ '_r' not in filename and \ '.a' not in filename: mysqlclient_libs.append(filepath) mysqlclient_libs.sort() stdout = None try: log.debug("# mysqlclient_lib: {0}".format(mysqlclient_libs[-1])) It seems to be the mysqlclient_libs list is empty due to filename.startswith('libmysqlclient') check. So maybe it will be great, not to limit clients to mysql or to check if len(mysqlclient_libs) > 0 prior accessing index.