Hi Tony,
[snip]
> I just ran into this issue myself. After a quick dig in the code, simplest way around it seems to be to ensure that you pass a str for the header and not a unicode object:
> headers['Content-Disposition'] = "attachment; filename*=UTF-8''" + os.path.basename(filename).encode('utf-8','ignore')
> Hope that helps.
Thanks, it certainly solved the problem when the file names are
strings that can be represented in ascii.
I do, however, have plenty of files which correspond to foreign
language text such as Japanese, and so it remains unsolved in that
context.