You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I have a dataset on utf-8, containing Spanish tilde chars. Here it is:
ESPAÑA
MADRID
FRANCIA
PARÍS
When trying to import with import_categories, it fails.
(pytesting)orestes-retina:core_categories$ python manage.py import_categories --settings=settings.development core_categories/fixtures/bug-categories-utf8.txt
Traceback (most recent call last):
File "manage.py", line 16, in <module>
execute_from_command_line(sys.argv)
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/django/core/management/__init__.py", line 399, in execute_from_command_line
utility.execute()
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/django/core/management/__init__.py", line 392, in execute
self.fetch_command(subcommand).run_from_argv(self.argv)
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/django/core/management/base.py", line 242, in run_from_argv
self.execute(*args, **options.__dict__)
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/django/core/management/base.py", line 285, in execute
output = self.handle(*args, **options)
File "/Users/orestes/Downloads/devel/bullipedia-core/core_categories/categories/management/commands/import_categories.py", line 90, in handle
self.parse_lines(data)
File "/Users/orestes/Downloads/devel/bullipedia-core/core_categories/categories/management/commands/import_categories.py", line 73, in parse_lines
current_parents = {0: self.make_category(line)}
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/django/db/transaction.py", line 431, in inner
return func(*args, **kwargs)
File "/Users/orestes/Downloads/devel/bullipedia-core/core_categories/categories/management/commands/import_categories.py", line 37, in make_category
slug=slugify(SLUG_TRANSLITERATOR(string.strip()))[:49],
File "/Users/orestes/Downloads/pytesting/lib/python2.7/site-packages/slugify.py", line 26, in slugify
unicodedata.normalize('NFKD', string)
TypeError: must be unicode, not str
Googling about the error I found a reference to slugify expecting a unicode string.
The text was updated successfully, but these errors were encountered:
I have a dataset on utf-8, containing Spanish tilde chars. Here it is:
When trying to import with import_categories, it fails.
Googling about the error I found a reference to slugify expecting a unicode string.
The text was updated successfully, but these errors were encountered: