Machine tracker crashes when inputting non-ASCII characters in search

Bug #1134390 reported by Morten Brekkevold
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Network Administration Visualized
Fix Released
Low
Morten Brekkevold

Bug Description

If one inputs an invalid search term in Machine Tracker's IP search, nothing seems to happen. If one inputs non-ASCII characters, however, the Machine Tracker crashes with a UnicodeEncodeError (NAV 3.13.0 and 3.13.1):

Environment:

Request Method: GET
Request URL: http://nav.example.org/machinetracker/ip/?ip_range=%C3%A6&active=on&days=7
Django Version: 1.2.3
Python Version: 2.6.6
Installed Applications:
['nav.django']
Installed Middleware:
('django.middleware.common.CommonMiddleware',)

Traceback:
File "/usr/lib/pymodules/python2.6/django/core/handlers/base.py" in get_response
  100. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/local/nav/lib/python/nav/web/machinetracker/views.py" in ip_search
  52. return ip_do_search(request)
File "/usr/local/nav/lib/python/nav/web/machinetracker/views.py" in ip_do_search
  72. if form.is_valid():
File "/usr/lib/pymodules/python2.6/django/forms/forms.py" in is_valid
  121. return self.is_bound and not bool(self.errors)
File "/usr/lib/pymodules/python2.6/django/forms/forms.py" in _get_errors
  112. self.full_clean()
File "/usr/lib/pymodules/python2.6/django/forms/forms.py" in full_clean
  267. self._clean_fields()
File "/usr/lib/pymodules/python2.6/django/forms/forms.py" in _clean_fields
  287. value = getattr(self, 'clean_%s' % name)()
File "/usr/local/nav/lib/python/nav/web/machinetracker/forms.py" in clean_ip_range
  49. data = str(self.cleaned_data['ip_range'])

Exception Type: UnicodeEncodeError at /machinetracker/ip/
Exception Value: 'ascii' codec can't encode character u'\xe6' in position 0: ordinal not in range(128)

Changed in nav:
assignee: Morten Brekkevold (mbrekkevold) → nobody
Revision history for this message
Morten Brekkevold (mbrekkevold) wrote :
Changed in nav:
status: Confirmed → In Progress
assignee: nobody → Morten Brekkevold (mbrekkevold)
status: In Progress → Fix Committed
Changed in nav:
milestone: 3.13.2 → 3.14.1
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.