Opened 17 years ago

Last modified 8 years ago

#6052 closed

SafeUnicode is not type.UnicodeType in _mysql.connection.escape — at Initial Version

Reported by: Alexander Owned by: nobody
Component: Database layer (models, ORM) Version: dev
Severity: Keywords: UnicodeBranch UnicodeEncodeError mysqldb SafeUnicode
Cc: djbenji@…, olau@…, tom@…, jarek.zgoda@…, eric@…, martin@…, simon@… Triage Stage: Unreviewed
Has patch: yes Needs documentation: no
Needs tests: no Patch needs improvement: no
Easy pickings: no UI/UX: no

Description

Hello.

cleaned_datacontent is type django.utils.safestring.SafeUnicode

This get error when recording in a database.

Because, the function can only identify unicode or any other as string.

In _mysql.c:
static PyObject * _escape_item( PyObject *item, PyObject *d){ PyObject *quoted=NULL, *itemtype, *itemconv;

if (!(itemtype = PyObject_Type(item))) goto error;
itemconv = PyObject_GetItem(d, itemtype);

Temporary solution to the problem: unicode(cleaned_datacontent)

Change History (0)

Note: See TracTickets for help on using tickets.
Back to Top