django-mysql-pymysql icon indicating copy to clipboard operation
django-mysql-pymysql copied to clipboard

mysql_pymysql/base.py can't find module SafeUnicode

Open zuxfoucault opened this issue 11 years ago • 2 comments

File "/usr/local/lib/python3.3/site-packages/mysql_pymysql/base.py", line 29, in from django.utils.safestring import SafeString, SafeUnicode ImportError: cannot import name SafeUnicode

Django version: Dev (Version 1.5 has same problem)


Modified the following...

SafeString ==> SafeBytes SafeUnicode ==> SafeText

File "/usr/local/Cellar/python3/3.3.1/Frameworks/Python.framework/Versions/3.3/lib/python3.3/site-packages/PyMySQL3-0.5-py3.3.egg/pymysql/cursors.py", line 108, in execute ==> 96 if isinstance(query, bytes): 97 query = query.encode(charset)

then seems worked...

zuxfoucault avatar Apr 25 '13 16:04 zuxfoucault

It seems that SafeUnicode and SafeString are removed completely in Django 1.5. The name changes are listed in the Porting to Python 3 documentation. A simple find-and-replace should be enough. @jloic's fork corrected this (and others); you might want to take a look.

uranusjr avatar May 15 '13 18:05 uranusjr

thanks for the info.

zuxfoucault avatar May 16 '13 07:05 zuxfoucault