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

Rocky Burt rocky at serverzen.com
Mon Jun 19 07:07:03 EDT 2006


Hmm, this seems strange to me.  How can it be guaranteed that the remote
filename is a utf-8 encoded byte string?  Not sure this should be done
this way anyhow.

- Rocky


On Mon, 2006-19-06 at 11:01 +0200, Adam Groszer wrote:
> 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  
> 
-- 
Rocky Burt
ServerZen Software -- http://www.serverzen.com
News About The Server (blog) -- http://www.serverzen.net

-------------- next part --------------
A non-text attachment was scrubbed...
Name: not available
Type: application/pgp-signature
Size: 191 bytes
Desc: This is a digitally signed message part
Url : http://mail.zope.org/pipermail/zope3-dev/attachments/20060619/9f47cfc7/attachment.bin


More information about the Zope3-dev mailing list