Misc. cleanup for Python 3
This commit is contained in:
parent
189bc1faa8
commit
ee35cc6f22
24 changed files with 49 additions and 36 deletions
|
@ -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
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue