#19101: Non ascii chars in form cause Internal Server Error
----------------------------+----------------------
     Reporter:  kristall    |      Owner:  nobody
         Type:  Bug         |     Status:  new
    Component:  Forms       |    Version:  master
     Severity:  Normal      |   Keywords:  encoding
 Triage Stage:  Unreviewed  |  Has patch:  0
Easy pickings:  0           |      UI/UX:  0
----------------------------+----------------------
 Trying to use non ascii chars in form cause trouble with python3.2 (same
 code works fine under python2.7).
 I used "python3 manage.py runserver"

 Internal Server Error: /formtest/
 Traceback (most recent call last):
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/base.py", line 110, in get_response
     response = middleware_method(request, callback, callback_args,
 callback_kwargs)
   File "/usr/local/lib/python3.2/site-packages/django/middleware/csrf.py",
 line 174, in process_view
     request_csrf_token = request.POST.get('csrfmiddlewaretoken', '')
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/wsgi.py", line 179, in _get_post
     self._load_post_and_files()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 340, in _load_post_and_files
     self._post, self._files = QueryDict(self.body,
 encoding=self._encoding), MultiValueDict()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 392, in __init__
     encoding=encoding):
   File "/usr/local/lib/python3.2/urllib/parse.py", line 608, in parse_qsl
     value = _coerce_result(value)
   File "/usr/local/lib/python3.2/urllib/parse.py", line 88, in
 _encode_result
     return obj.encode(encoding, errors)
 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2:
 ordinal not in range(128)
 Traceback (most recent call last):
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/base.py", line 110, in get_response
     response = middleware_method(request, callback, callback_args,
 callback_kwargs)
   File "/usr/local/lib/python3.2/site-packages/django/middleware/csrf.py",
 line 174, in process_view
     request_csrf_token = request.POST.get('csrfmiddlewaretoken', '')
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/wsgi.py", line 179, in _get_post
     self._load_post_and_files()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 340, in _load_post_and_files
     self._post, self._files = QueryDict(self.body,
 encoding=self._encoding), MultiValueDict()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 392, in __init__
     encoding=encoding):
   File "/usr/local/lib/python3.2/urllib/parse.py", line 608, in parse_qsl
     value = _coerce_result(value)
   File "/usr/local/lib/python3.2/urllib/parse.py", line 88, in
 _encode_result
     return obj.encode(encoding, errors)
 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2:
 ordinal not in range(128)

 During handling of the above exception, another exception occurred:

 Traceback (most recent call last):
   File "/usr/local/lib/python3.2/wsgiref/handlers.py", line 137, in run
     self.result = application(self.environ, self.start_response)
   File "/usr/local/lib/python3.2/site-
 packages/django/contrib/staticfiles/handlers.py", line 71, in __call__
     return self.application(environ, start_response)
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/wsgi.py", line 236, in __call__
     response = self.get_response(request)
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/base.py", line 180, in get_response
     response = self.handle_uncaught_exception(request, resolver,
 sys.exc_info())
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/base.py", line 222, in
 handle_uncaught_exception
     return debug.technical_500_response(request, *exc_info)
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 69, in technical_500_response
     html = reporter.get_traceback_html()
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 289, in get_traceback_html
     c = Context(self.get_traceback_data())
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 247, in get_traceback_data
     frames = self.get_traceback_frames()
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 398, in get_traceback_frames
     'vars': self.filter.get_traceback_frame_variables(self.request,
 tb.tb_frame),
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 197, in get_traceback_frame_variables
     value = self.get_request_repr(value)
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 105, in get_request_repr
     return build_request_repr(request,
 POST_override=self.get_post_parameters(request))
   File "/usr/local/lib/python3.2/site-packages/django/views/debug.py",
 line 154, in get_post_parameters
     return request.POST
   File "/usr/local/lib/python3.2/site-
 packages/django/core/handlers/wsgi.py", line 179, in _get_post
     self._load_post_and_files()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 340, in _load_post_and_files
     self._post, self._files = QueryDict(self.body,
 encoding=self._encoding), MultiValueDict()
   File "/usr/local/lib/python3.2/site-packages/django/http/__init__.py",
 line 392, in __init__
     encoding=encoding):
   File "/usr/local/lib/python3.2/urllib/parse.py", line 608, in parse_qsl
     value = _coerce_result(value)
   File "/usr/local/lib/python3.2/urllib/parse.py", line 88, in
 _encode_result
     return obj.encode(encoding, errors)
 UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-2:
 ordinal not in range(128)

-- 
Ticket URL: <https://code.djangoproject.com/ticket/19101>
Django <https://code.djangoproject.com/>
The Web framework for perfectionists with deadlines.

-- 
You received this message because you are subscribed to the Google Groups 
"Django updates" group.
To post to this group, send email to [email protected].
To unsubscribe from this group, send email to 
[email protected].
For more options, visit https://groups.google.com/groups/opt_out.


Reply via email to