Misc. cleanup for Python 3

This commit is contained in:
Lance Edgar 2018-02-12 14:41:40 -06:00
parent 189bc1faa8
commit ee35cc6f22
24 changed files with 49 additions and 36 deletions

View file

@ -1148,7 +1148,7 @@ class FileBatchMasterView(BatchMasterView):
raise httpexceptions.HTTPNotFound()
path = batch.filepath(self.rattail_config)
response = FileResponse(path, request=self.request)
response.headers[b'Content-Length'] = str(os.path.getsize(path))
response.headers[b'Content-Length'] = six.binary_type(os.path.getsize(path))
filename = os.path.basename(batch.filename).encode('ascii', 'replace')
response.headers[b'Content-Disposition'] = b'attachment; filename="{}"'.format(filename)
return response