[Zope3-dev] SVN: Zope3/branches/3.3/ Fixed issues 648 and 593: uploading files with non-ASCII filenames now works.

Adam Groszer adamg at fw.hu
Mon Jun 19 05:01:16 EDT 2006


Hi Marius,

Your fix of browser.py causes problems for me using hurry.file when
running functional test with zope.testbrowser.
The problem is that aFieldStorage.filename is already unicode and it
cannot be decoded again.

Do you mind if I add an
if isinstance(aFieldStorage.filename, unicode):
construct?

Modified: Zope3/trunk/src/zope/publisher/browser.py
===================================================================
--- Zope3/trunk/src/zope/publisher/browser.py2006-06-13 22:00:47 UTC (rev 68625)
+++ Zope3/trunk/src/zope/publisher/browser.py2006-06-14 12:25:49 UTC (rev 68626)
@@ -596,7 +596,7 @@
                 d[m] = getattr(file,m)
 
         self.headers = aFieldStorage.headers
-        self.filename = aFieldStorage.filename
+        self.filename = unicode(aFieldStorage.filename, 'UTF-8')
 
 class RedirectingBrowserRequest(BrowserRequest):
     """Browser requests that redirect when the actual and effective URLs differ  

-- 
Best regards,
 Adam                          mailto:adamg at fw.hu
--
Quote of the day:
We are all dangerous folk without God's controlling hand. 
- William Ward Ayer 



More information about the Zope3-dev mailing list