dotcloud/docker-registry — pull request #216 by dustinlacewell (2014-01-20 23:20:36+00:00)
Title: Update tarfile summation to handle undecodable unicode errors

This patch fixes the following exception:

Exception on /v1/images/3072260786c47aa6dd3ae39d860f1423ace97f42b431a9f403da01206d75f1a1/layer [PUT]
Traceback (most recent call last):
File "/home/dotcloud/env/lib/python2.7/site-packages/flask/app.py", line 1687, in wsgi_app
response = self.full_dispatch_request()
File "/home/dotcloud/env/lib/python2.7/site-packages/flask/app.py", line 1360, in full_dispatch_request
rv = self.handle_user_exception(e)
File "/home/dotcloud/env/lib/python2.7/site-packages/flask/app.py", line 1358, in full_dispatch_request
rv = self.dispatch_request()
File "/home/dotcloud/env/lib/python2.7/site-packages/flask/app.py", line 1344, in dispatch_request
return self.view_functions[rule.endpoint](**req.view_args)
File "/home/dotcloud/registry/toolkit.py", line 203, in wrapper
return f(*args, **kwargs)
File "/home/dotcloud/registry/images.py", line 159, in put_image_layer
for member in tar:
File "/usr/lib/python2.7/tarfile.py", line 2470, in next
tarinfo = self.tarfile.next()
File "/usr/lib/python2.7/tarfile.py", line 2323, in next
tarinfo = self.tarinfo.fromtarfile(self)
File "/usr/lib/python2.7/tarfile.py", line 1240, in fromtarfile
return obj._proc_member(tarfile)
File "/usr/lib/python2.7/tarfile.py", line 1262, in _proc_member
return self._proc_pax(tarfile)
File "/usr/lib/python2.7/tarfile.py", line 1392, in _proc_pax
value = value.decode("utf8")
File "/home/dotcloud/env/lib/python2.7/encodings/utf_8.py", line 16, in decode
return codecs.utf_8_decode(input, errors, True)
UnicodeDecodeError: 'utf8' codec can't decode byte 0xdb in position 16: invalid continuation byte