Re: bug in file download link?
Sylvain Thénault <sylvain.thenault-yG1kfhx/[email protected]> Fri, 16 Jun 2006 11:43:53 +0200
| Newsgroups | gmane.comp.web.zope.plone.archetypes.devel |
|---|---|
| Message-ID | <[email protected]> |
the patch... On Friday 16 June à 11:35, Sylvain Thénault wrote: > Hi, > > I've hitted a bug into Archetypes/utils.py contentDispositionHeader > function leading to bad download file name when this one contains non > ascii char, but I've been very surprised since no one fixed that while > the fix is so obvious. So I asked myself what's the trap... Actually > without this fix this function is missing all its job imo (though even > with it download name are not always understood by every browser). > I've attached the patch, if no one quickly tell me "hey that was > intentional because...", I'll check it in next week. -- Sylvain Thénault LOGILAB, Paris (France) Formations Python, Zope, Plone, Debian: http://www.logilab.fr/formations Développement logiciel sur mesure: http://www.logilab.fr/services Python et calcul scientifique: http://www.logilab.fr/science _______________________________________________ Archetypes-devel mailing list Archetypes-devel-5NWGOfrQmneRv+LV9MX5uipxlwaOVQ5f@public.gmane.org https://lists.sourceforge.net/lists/listinfo/archetypes-devel
archetypes_utils.py.patch
(text/plain, 445 B)
--- Products/Archetypes/utils.py 2006-06-03 18:49:52.000000000 +0200
+++ /home/syt/cvs_work/Archetypes/utils.py 2006-05-12 11:51:00.000000000 +0200
@@ -938,7 +939,7 @@
unicode(value, 'us-ascii', 'strict')
except UnicodeDecodeError:
value = (charset, language, value)
-
+ kw[key] = value
m = Message()
m.add_header('content-disposition', disposition, **kw)
return m['content-disposition']