From c33b17d3251ba8db2ab3513f89f3823c210d0fe6 Mon Sep 17 00:00:00 2001 From: INADA Naoki Date: Sun, 28 Aug 2016 13:20:24 +0900 Subject: [PATCH] Fix cursor doesn't use converter in connection (#503) --- pymysql/cursors.py | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-) diff --git a/pymysql/cursors.py b/pymysql/cursors.py index c42808b..c3e16ba 100644 --- a/pymysql/cursors.py +++ b/pymysql/cursors.py @@ -5,7 +5,6 @@ import re import warnings from ._compat import range_type, text_type, PY2 - from . import err @@ -116,12 +115,12 @@ class Cursor(object): if isinstance(args, (tuple, list)): if PY2: args = tuple(map(ensure_bytes, args)) - return tuple(conn.escape(arg) for arg in args) + return tuple(conn.literal(arg) for arg in args) elif isinstance(args, dict): if PY2: args = dict((ensure_bytes(key), ensure_bytes(val)) for (key, val) in args.items()) - return dict((key, conn.escape(val)) for (key, val) in args.items()) + return dict((key, conn.literal(val)) for (key, val) in args.items()) else: # If it's not a dictionary let's try escaping it anyways. # Worst case it will throw a Value error