Opened 17 years ago
Last modified 8 years ago
#6052 closed
SafeUnicode is not type.UnicodeType in _mysql.connection.escape — at Version 1
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 (last modified by )
Hello.
cleaned_data['content']
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_data['content'])
Note:
See TracTickets
for help on using tickets.
Fixed description formatting.