cursor.description column names reported as bytes in python 3

Bug #933512 reported by Mike Bayer on 2012-02-16
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
Triaged
Low
Geert JM Vanderkelen

Bug Description

Python 3.2, MySQL connector/python 0.3.2-devel

from mysql import connector

conn = connector.connect(user='scott', password='tiger', host='localhost', database='test')

cursor = conn.cursor()

cursor.execute("SELECT 1 AS a, 2 AS b, 3 AS c")

colnames = [desc[0] for desc in cursor.description]
assert colnames == ['a', 'b', 'c'], colnames

output:

Traceback (most recent call last):
  File "test.py", line 10, in <module>
    assert colnames == ['a', 'b', 'c'], colnames
AssertionError: [bytearray(b'a'), bytearray(b'b'), bytearray(b'c')]

We should make sure they it is returned as unicode yes, decoded from whatever character set was used.

Changed in myconnpy:
importance: Undecided → Low
status: New → Confirmed
assignee: nobody → Geert JM Vanderkelen (geertjmvdk)

This bug was moved to http://bugs.mysql.com/bug.php?id=64392

Please add comments or subscribe using the above URL.

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

Other bug subscribers

Remote bug watches

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