django-cities-light
django-cities-light copied to clipboard
Warning: Incorrect string value: '\xCA\xBCs al...' for column 'name' at row 1
This is the complete stack trace of the issue, generating while running "python manage.py cities_light" command:
/usr/local/lib/python2.7/dist-packages/autoslug/utils.py:30: RuntimeWarning: Argument <type 'str'> is not an unicode object. Passing an encoded string will likely have unexpected results. return django_slugify(unidecode(value))
RAM used: 31420 kB Time: 0:00:00 Done: 100%|###################################| Warning: Incorrect string value: '\xCA\xBCs al...' for column 'name' at row 1
What OS ?
Is there any way I can reproduce this ?
Could you reproduce it in a virtualenv ? I see that you probably ran sudo pip install which is not a good idea because it would install packages globally and potentially mess with python dependencies for system-installed tools.
It's Ubuntu 12.04. You can reproduce is by importing the data into the tables. I can see some characters in the name field of City API which might be causing the char set issue.
Which database are you using? I suspect it is a problem related to encoding using MySQL.
Did you try with python 3 ?
No, it was python 2.7.5 and yes, I was using MYSQL database.
On Mon, Dec 29, 2014 at 3:41 PM, James Pic [email protected] wrote:
Did you try with python 3 ?
— Reply to this email directly or view it on GitHub https://github.com/yourlabs/django-cities-light/issues/62#issuecomment-68245548 .
Might be fixed by #77
Which CHARACTER SET and COLLATE is your mysql database?
change your database and its tables to support ut8, it will fix the issue.
change your database and its tables to support ut8, it will fix the issue.
YES, 4 example:
CREATE DATABASE weblate CHARACTER SET utf8mb4 COLLATE utf8mb4_unicode_ci;