Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

importing csv UnicodeEncodeError #347

Closed
pacotole opened this issue Nov 17, 2015 · 3 comments
Closed

importing csv UnicodeEncodeError #347

pacotole opened this issue Nov 17, 2015 · 3 comments
Labels

Comments

@pacotole
Copy link
Contributor

On import I get an UnicodeEncodeError error.

The error is produced only on version 0.2.9, on previous versions (0.2.8 and 0.2.7 tested) works as expected.

This is the traceback:

Django Version: 1.8.6
Python Version: 2.7.6
...

Traceback:
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/django/core/handlers/base.py" in get_response
  132.                     response = wrapped_callback(request, *callback_args, **callback_kwargs)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/django/utils/decorators.py" in _wrapped_view
  110.                     response = view_func(request, *args, **kwargs)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/django/views/decorators/cache.py" in _wrapped_view_func
  57.         response = view_func(request, *args, **kwargs)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/django/contrib/admin/sites.py" in inner
  233.             return view(request, *args, **kwargs)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/import_export/admin.py" in import_action
  222.             dataset = input_format.create_dataset(data)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/import_export/formats/base_formats.py" in create_dataset
  90.         self.get_format().import_set(data, in_stream)
File "/home/pacotole/myproject/.env/local/lib/python2.7/site-packages/tablib/formats/_csv.py" in import_set
  40.         rows = csv.reader(StringIO(in_stream), encoding=DEFAULT_ENCODING)

Exception Type: UnicodeEncodeError at /admin/products/product/import/
Exception Value: 'ascii' codec can't encode character u'\xe1' in position 148: ordinal not in range(128)
@bmihelac
Copy link
Member

Thanks for reporting @pacotole.

This should be fixed in 49bf63e. Can you please check if it works for you?

@bmihelac
Copy link
Member

Fixed in 0.3. please reopen if needed

@pacotole
Copy link
Contributor Author

Now it works perfect!!

Thanks

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants