database name *must* be of type str()
Bug #790226 reported by
tormen
This bug affects 1 person
Affects | Status | Importance | Assigned to | Milestone | ||
---|---|---|---|---|---|---|
MySQL Connector/Python | Status tracked in Trunk | |||||
0.3 |
Fix Committed
|
Low
|
Geert JM Vanderkelen | |||
Trunk |
In Progress
|
Low
|
Geert JM Vanderkelen |
Bug Description
MySQL connector/python v0.3.2:
if you pass in a database name "1234" then mysql connector/python [connector.py line 381] tries to do a .strip() on it which will fail as it is not a string.
It is probably arguable if this is a bug ...
but to me as python is officially dynamically typed [oh-yeah! ;) ...]
IMHO this line should be either:
self._database = str(database)
OR to save the str() call if not necessary:
try: self._database = database.strip() if database else None
except: self._database = str(database)
Related branches
To post a comment you must log in.
Thanks for this bug report!
Fix: Unhandled exception when database was given as integer
o There was an unhandled exception when you pass the database name as an .connect( )
integer. We now force the database name to be a string.
o Using self._username and self._database when opening the connection
in MySQLConnection
o Adding test case for bug lp:790226