conversion.py: def quote() does not check for bytes

Bug #750657 reported by tormen
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
MySQL Connector/Python
Confirmed
Low
Geert JM Vanderkelen

Bug Description

MySQL Connector/Python version 0.3.2:

As I pointed out in the added comment to my question [sorry for the long title]:
https://answers.launchpad.net/myconnpy/+question/151646

Looking in conversion.py at .escape(): It seems to work transparently on bytes and strings,
but .quote() does NOT ... it misses the "if isinstance(value,bytes)" IMHO?!

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

This is more a python3 problem, correct?

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

The MySQLConverter.quote() can't be used directly, you have for first convert to something MySQL understands, for example:
  c = MySQLConverter()
  c.quote(c.escape('ham'))

We might need a quote() function which can be used directly, without the need for first escaping it, although it would be doing what the above does.

Changed in myconnpy:
status: New → Confirmed
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.