bug in error message creation

Bug #758792 reported by Christian Herdtweck
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
Fix Committed
Low
Geert JM Vanderkelen

Bug Description

just installed MySQL Connector/Python, configured examples in python2 sub-dir, tried to run engine.py and got following error:
myDir> src/mysql-connector-python-0.3.2-devel/python2/examples> python engines.py
Traceback (most recent call last):
  File "engines.py", line 35, in <module>
    main(config)
  File "engines.py", line 16, in main
    db = mysql.connector.Connect(**config)
  File "/home/localDummy/localRoot/lib/python2.6/site-packages/mysql/connector/__init__.py", line 45, in Connect
    return MySQLConnection(*args, **kwargs)
  File "/home/localDummy/localRoot/lib/python2.6/site-packages/mysql/connector/connection.py", line 366, in __init__
    self.connect(*args, **kwargs)
  File "/home/localDummy/localRoot/lib/python2.6/site-packages/mysql/connector/connection.py", line 411, in connect
    ssl=(ssl_ca, ssl_cert, ssl_key))
  File "/home/localDummy/localRoot/lib/python2.6/site-packages/mysql/connector/connection.py", line 445, in _open_connection
    "MySQL Version %s is not supported." % version)
TypeError: not all arguments converted during string formatting

--> probably a minor bug in creating the error message
db.__version__: (0, 3, 2, 'devel', 292)
python --version: Python 2.6.2
mysql -NB -e "SELECT VERSION()": 3.23.59-nightly-20050301
Linux clientHost 2.6.28-19-generic #65-Ubuntu SMP Thu Sep 16 14:14:28 UTC 2010 i686 GNU/Linux
Linux serverHost 2.6.28-19-server #66-Ubuntu SMP Sat Oct 16 18:41:24 UTC 2010 i686 GNU/Linux

Related branches

Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Yes, the error should not give an error. :)

(Note however that we will not support MySQL 3.23.)

Changed in myconnpy:
status: New → Confirmed
importance: Undecided → Low
assignee: nobody → Geert JM Vanderkelen (geertjmvdk)
Revision history for this message
Geert JM Vanderkelen (geertjmvdk) wrote :

Quickly fixing this with something like this:

         if version < (4,1):
                raise errors.InterfaceError(
                    "MySQL Version %s is not supported." % \
                    self.protocol.server_version_original)

Revision history for this message
Christian Herdtweck (christian-herdtweck-deactivatedaccount) wrote : Re: [Bug 758792] Re: bug in error message creation

thanks!

On 02/11/11 14:29, Geert JM Vanderkelen wrote:
> Quickly fixing this with something like this:
>
> if version< (4,1):
> raise errors.InterfaceError(
> "MySQL Version %s is not supported." % \
> self.protocol.server_version_original)
>

Changed in myconnpy:
status: Confirmed → Fix Committed
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.