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

Wagtailforms CSV export crashes on Python 3 when unicodecsv is installed #1295

Closed
kaedroho opened this issue May 13, 2015 · 1 comment
Closed
Labels
Milestone

Comments

@kaedroho
Copy link
Contributor

unicodecsv now supports Python 3 so it's possible for a user to have it installed.

When it is installed, Wagtail tries to use it and will crash with the following error:

======================================================================
ERROR: test_list_submissions_csv_export (wagtail.wagtailforms.tests.TestFormsSubmissions)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/home/karl/projects/wagtail/wagtail/wagtailforms/tests.py", line 356, in test_list_submissions_csv_export
    response = self.client.get(reverse('wagtailforms_list_submissions', args=(self.form_page.id, )), {'date_from': '01/01/2014', 'action': 'CSV'})
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/test/client.py", line 470, in get
    **extra)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/test/client.py", line 286, in get
    return self.generic('GET', path, secure=secure, **r)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/test/client.py", line 358, in generic
    return self.request(**r)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/test/client.py", line 440, in request
    six.reraise(*exc_info)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/utils/six.py", line 659, in reraise
    raise value
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/core/handlers/base.py", line 111, in get_response
    response = wrapped_callback(request, *callback_args, **callback_kwargs)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/views/decorators/cache.py", line 38, in _cache_controlled
    response = viewfunc(request, *args, **kw)
  File "/home/karl/projects/wagtail/venv/lib/python3.4/site-packages/django/contrib/auth/decorators.py", line 21, in _wrapped_view
    return view_func(request, *args, **kwargs)
  File "/home/karl/projects/wagtail/wagtail/wagtailforms/views.py", line 73, in list_submissions
    writer = csv.writer(response, encoding='utf-8')
TypeError: 'encoding' is an invalid keyword argument for this function
@gasman gasman added this to the 0.8.8 milestone May 13, 2015
kaedroho added a commit that referenced this issue May 20, 2015
The wheel file for Python 2 and Python 3 need to be slightly different as unicodecsv cannot be a dependency when using Python 3 (issue #1295)
@zerolab
Copy link
Contributor

zerolab commented Jun 2, 2015

PR: #1365

@kaedroho kaedroho closed this as completed Jun 3, 2015
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

3 participants