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

'surrogates not allowed' error on stored procedure call for unicode argument #90

Copy link
Copy link
Closed
@jinto

Description

@jinto
Issue body actions

On python 3.5.1, mysqlclient 1.3.7

cursor.callproc() with unicode string argument generates error below
'utf-8' codec can't encode character '\udceb' in position 39: surrogates not allowed

The code works if I change below code

def literal(self, o): 
    s = self.escape(o, self.encoders)
    if not PY2 and isinstance(s, bytes):
        return s.decode('ascii', 'surrogateescape')
    return s

to

def literal(self, o): 
    s = self.escape(o, self.encoders)
    if not PY2 and isinstance(s, bytes):
        return s.decode('utf8', 'surrogateescape')
    return s

changes : 'ascii' to 'utf8'
ps. tested string was korean string, "제권".

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

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