When simple invalid xpm files are submitted with an app, the app crashes and burns with the following traceback:
Traceback (most recent call last):
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/core/handlers/base.py", line 111, in get_response
response = callback(request, *callback_args, **callback_kwargs)
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/views/decorators/cache.py", line 79, in _wrapped_view_func
response = view_func(request, *args, **kwargs)
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/contrib/auth/decorators.py", line 23, in _wrapped_view
return view_func(request, *args, **kwargs)
File "/srv/sc.ubuntu.com/production/software-center-agent/src/devportal/decorators.py", line 84, in inner_decorator
return func(request, *args, **kwargs)
File "/srv/sc.ubuntu.com/production/software-center-agent/src/devportal/views.py", line 326, in application_update
if form.is_valid():
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/forms/forms.py", line 121, in is_valid
return self.is_bound and not bool(self.errors)
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/forms/forms.py", line 112, in _get_errors
self.full_clean()
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/forms/forms.py", line 267, in full_clean
self._clean_fields()
File "/srv/sc.ubuntu.com/production/software-center-agent/sourcecode/django/django/forms/forms.py", line 287, in _clean_fields
value = getattr(self, 'clean_%s' % name)()
File "/srv/sc.ubuntu.com/production/software-center-agent/src/softwarecenteragent/forms.py", line 91, in clean_icon_64
return self._clean_icon(64)
File "/srv/sc.ubuntu.com/production/software-center-agent/src/softwarecenteragent/forms.py", line 75, in _clean_icon
icon = Image.open(icon_file)
File "/usr/lib/python2.6/dist-packages/PIL/Image.py", line 1976, in open
return factory(fp, filename)
File "/usr/lib/python2.6/dist-packages/PIL/ImageFile.py", line 91, in __init__
self._open()
File "/usr/lib/python2.6/dist-packages/PIL/XpmImagePlugin.py", line 93, in _open
raise ValueError, "cannot read this XPM file"
ValueError: cannot read this XPM file
For example, you can try submitting a file called "test.xpm", containing "foo".
The traceback here is from slightly broken XPM, more complicated than just "foo". When submitting "foo", the error is: pymodules/ python2. 6/django/ core/handlers/ base.py" in get_response pymodules/ python2. 6/django/ views/decorator s/cache. py" in _wrapped_view_func pymodules/ python2. 6/django/ contrib/ auth/decorators .py" in __call__ func(request, *args, **kwargs) ubuntu. com/production/ software- center- agent/src/ devportal/ decorators. py" in inner_decorator ubuntu. com/production/ software- center- agent/src/ devportal/ views.py" in application_update pymodules/ python2. 6/django/ forms/forms. py" in is_valid pymodules/ python2. 6/django/ forms/forms. py" in _get_errors pymodules/ python2. 6/django/ forms/forms. py" in full_clean ubuntu. com/production/ software- center- agent/src/ softwarecentera gent/forms. py" in clean_icon_16 icon(16) ubuntu. com/production/ software- center- agent/src/ softwarecentera gent/forms. py" in _clean_icon icon_file) python2. 6/dist- packages/ PIL/Image. py" in open
File "/usr/lib/
92. response = callback(request, *callback_args, **callback_kwargs)
File "/usr/lib/
44. response = view_func(request, *args, **kwargs)
File "/usr/lib/
78. return self.view_
File "/srv/sc.
83. return func(request, *args, **kwargs)
File "/srv/sc.
319. if form.is_valid():
File "/usr/lib/
120. return self.is_bound and not bool(self.errors)
File "/usr/lib/
111. self.full_clean()
File "/usr/lib/
243. value = getattr(self, 'clean_%s' % name)()
File "/srv/sc.
96. return self._clean_
File "/srv/sc.
72. icon = Image.open(
File "/usr/lib/
1980. raise IOError("cannot identify image file")
IOError instead of ValueError.