Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Christian Theune
Hi, On 03/01/2010 05:04 PM, Adam GROSZER wrote: > Hello Christian, > > Isn't it that anything below chr(128) converts to utf-8 as the same > character? That would mean that slash and ampersand will stay as it > is. No. The spec says that if you want to use a reserved character (depending on the

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Adam GROSZER
Hello Christian, Isn't it that anything below chr(128) converts to utf-8 as the same character? That would mean that slash and ampersand will stay as it is. OTOH encoding is done only on non-ascii characters. Supposed that the encoding is utf-8. What's hardwired into absoluteURL. Monday, March 1,

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Adam GROSZER
Hello, Thinking about the problem and this itself the following comes to my mind. I guess we're using most of the redirect with absoluteURL(). And what does absoluteURL do? It converts unicode object names to a URL. Seemingly in a simple way. We feed then this URL to redirect(). The edge case that

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Christian Theune
On 03/01/2010 03:34 PM, Wichert Akkerman wrote: > On 3/1/10 15:09 , Christian Theune wrote: >> Hi, >> >> On 03/01/2010 02:28 PM, Martin Aspeli wrote: >>> >>> I'm with Wichert here. >>> >>> In most places, we tend to carry around unicode strings internally, and >>> only encode on the boundaries, e.g

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Wichert Akkerman
On 3/1/10 15:09 , Christian Theune wrote: > Hi, > > On 03/01/2010 02:28 PM, Martin Aspeli wrote: >> >> I'm with Wichert here. >> >> In most places, we tend to carry around unicode strings internally, and >> only encode on the boundaries, e.g. when the URL is "rendered". I don't >> see why redirect(

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Christian Theune
Hi, On 03/01/2010 02:28 PM, Martin Aspeli wrote: > > I'm with Wichert here. > > In most places, we tend to carry around unicode strings internally, and > only encode on the boundaries, e.g. when the URL is "rendered". I don't > see why redirect() can't have a sensible and predictable policy for

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Martin Aspeli
Wichert Akkerman wrote: > On 3/1/10 13:41 , Tres Seaver wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Marius Gedminas wrote: >>> On Sun, Feb 28, 2010 at 05:05:51PM +0100, Wichert Akkerman wrote: On 2010-2-26 18:25, Tres Seaver wrote: > Wichert Akkerman wrote: >> I se

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Wichert Akkerman
On 3/1/10 13:41 , Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Marius Gedminas wrote: >> On Sun, Feb 28, 2010 at 05:05:51PM +0100, Wichert Akkerman wrote: >>> On 2010-2-26 18:25, Tres Seaver wrote: Wichert Akkerman wrote: > I see this as naming confusion. In thi

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Marius Gedminas wrote: > On Sun, Feb 28, 2010 at 05:05:51PM +0100, Wichert Akkerman wrote: >> On 2010-2-26 18:25, Tres Seaver wrote: >>> Wichert Akkerman wrote: I see this as naming confusion. In this day and age every URL is effectively an I

Re: [Zope-dev] redirect burps on unicode URLs

2010-03-01 Thread Marius Gedminas
On Sun, Feb 28, 2010 at 05:05:51PM +0100, Wichert Akkerman wrote: > On 2010-2-26 18:25, Tres Seaver wrote: > > Wichert Akkerman wrote: > >> I see this as naming confusion. In this day and age every URL is > >> effectively an IRI, and every modern browser treats them that way. If > >> you look at ht

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-28 Thread Wichert Akkerman
On 2010-2-26 18:25, Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Wichert Akkerman wrote: >> On 2/25/10 17:08 , Tres Seaver wrote: >>> -BEGIN PGP SIGNED MESSAGE- >>> Hash: SHA1 >>> >>> Adam GROSZER wrote: Hello, Looks like zope.publisher burps on un

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-26 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Wichert Akkerman wrote: > On 2/25/10 17:08 , Tres Seaver wrote: >> -BEGIN PGP SIGNED MESSAGE- >> Hash: SHA1 >> >> Adam GROSZER wrote: >>> Hello, >>> >>> Looks like zope.publisher burps on unicode URL which contain non-ascii >>> chars. This is f

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-26 Thread Christian Theune
On 02/26/2010 04:12 PM, Adam GROSZER wrote: > Hello, > > Some background: > This arises when you try to access a url which has non-ascii in it > (but is well encoded), usually a document uploaded by a user. > Then the loginform comes with it's camefrom parameter. > On successful login yo uget redi

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-26 Thread Adam GROSZER
Hello, Some background: This arises when you try to access a url which has non-ascii in it (but is well encoded), usually a document uploaded by a user. Then the loginform comes with it's camefrom parameter. On successful login yo uget redirected to the camefrom url, which gets unencoded to unicod

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-26 Thread Wichert Akkerman
On 2/25/10 17:08 , Tres Seaver wrote: > -BEGIN PGP SIGNED MESSAGE- > Hash: SHA1 > > Adam GROSZER wrote: >> Hello, >> >> Looks like zope.publisher burps on unicode URL which contain non-ascii >> chars. This is from a KGS 3.4 application, but looking at the source >> it still seems to have th

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-25 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam GROSZER wrote: > Hello, > > Looks like zope.publisher burps on unicode URL which contain > non-ascii chars. This is from a KGS 3.4 application, but looking > at the source it still seems to have the same problems. > > opinions? > > ... self.reques

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-25 Thread Andreas Jung
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam GROSZER wrote: As Tres pointed out: URLs must be properly encoded and it is not safe to pass python unicode strings to APIs expecting byte strings. Andreas -BEGIN PGP SIGNATURE- Version: GnuPG v1.4.10 (Darwin) Comment: Using GnuPG with

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-25 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE- Hash: SHA1 Adam GROSZER wrote: > Hello, > > Looks like zope.publisher burps on unicode URL which contain non-ascii > chars. This is from a KGS 3.4 application, but looking at the source > it still seems to have the same problems. > > opinions? > > ... > se

Re: [Zope-dev] redirect burps on unicode URLs

2010-02-25 Thread Wichert Akkerman
I suspect many parts in Zope are not up to handling unicode URLs. A bug I'ld say :) Wichert. On 2/25/10 15:00 , Adam GROSZER wrote: > Hello, > > Looks like zope.publisher burps on unicode URL which contain non-ascii > chars. This is from a KGS 3.4 application, but looking at the source > it stil

[Zope-dev] redirect burps on unicode URLs

2010-02-25 Thread Adam GROSZER
Hello, Looks like zope.publisher burps on unicode URL which contain non-ascii chars. This is from a KGS 3.4 application, but looking at the source it still seems to have the same problems. opinions? ... self.request.response.redirect(url) File "d:\home\.buildout\eggs\zope.publisher-3.4.6-