Skip to content

Commit c33b17d

Browse files
authored
Fix cursor doesn't use converter in connection (PyMySQL#503)
1 parent 7eac3b1 commit c33b17d

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

pymysql/cursors.py

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,6 @@
55
import warnings
66

77
from ._compat import range_type, text_type, PY2
8-
98
from . import err
109

1110

@@ -116,12 +115,12 @@ def _escape_args(self, args, conn):
116115
if isinstance(args, (tuple, list)):
117116
if PY2:
118117
args = tuple(map(ensure_bytes, args))
119-
return tuple(conn.escape(arg) for arg in args)
118+
return tuple(conn.literal(arg) for arg in args)
120119
elif isinstance(args, dict):
121120
if PY2:
122121
args = dict((ensure_bytes(key), ensure_bytes(val)) for
123122
(key, val) in args.items())
124-
return dict((key, conn.escape(val)) for (key, val) in args.items())
123+
return dict((key, conn.literal(val)) for (key, val) in args.items())
125124
else:
126125
# If it's not a dictionary let's try escaping it anyways.
127126
# Worst case it will throw a Value error

0 commit comments

Comments
 (0)