Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Appearance settings

Commit ee6ad1c

Browse filesBrowse files
committed
unicode string in argument of string raises error
Hi, I've got 'surrogates not allowed' error when I put unicode string into stored procedure's argument. This is pr for the issue. cf: PyMySQL#90 .
1 parent ae9d6f8 commit ee6ad1c
Copy full SHA for ee6ad1c

File tree

Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed
Filter options
Expand file treeCollapse file tree

1 file changed

+1
-1
lines changed

‎MySQLdb/cursors.py

Copy file name to clipboardExpand all lines: MySQLdb/cursors.py
+1-1Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -358,7 +358,7 @@ def callproc(self, procname, args=()):
358358
','.join(['@_%s_%d' % (procname, i)
359359
for i in range(len(args))]))
360360
if isinstance(q, unicode):
361-
q = q.encode(db.unicode_literal.charset)
361+
q = q.encode(db.unicode_literal.charset, 'surrogateescape')
362362
self._query(q)
363363
self._executed = q
364364
if not self._defer_warnings:

0 commit comments

Comments
0 (0)
Morty Proxy This is a proxified and sanitized view of the page, visit original site.