[Zope3-dev] Re: Apache rewrite rules and URLs: an experiment

Bjorn Tillenius bjoti777 at student.liu.se
Thu Nov 4 10:44:37 EST 2004


On Thu, Nov 04, 2004 at 09:48:56AM -0500, Jim Fulton wrote:
> Peter Mayne wrote:
> >If I try the above <tal:block> when I access Zope directly, it works. 
> >However, if I access it via Apache, I get:
> >
> >...
> >  File "C:\opt\Python23\Lib\site-packages\zope\tal\talinterpreter.py", 
> >line 451, in do_insertText_tal
> >    text = self.engine.evaluateText(stuff[0])
> >  File 
> >"C:\opt\Python23\Lib\site-packages\zope\app\pagetemplate\engine.py", 
> >line 105, in evaluateText
> >    return unicode(text)
> >  File 
> >"C:\opt\Python23\Lib\site-packages\zope\app\traversing\browser\absoluteur
> >l.py", line 101, in __unicode__
> >    return urllib.unquote(self.__str__()).decode('utf-8')
> >AttributeError: 'unicode' object has no attribute 'decode'
> 
> That's odd.
> 
> >I'm not even going to think about why this is happening.
> 
> Suit yourself.  Someone should think about why it's happening.

I would guess that some variable that apache sets to determine the host
is being represented as a unicode string. Due to this
request.getApplicationURL() returns a unicode string as well, instead of
an ascii string, which it normally does.

I can take a closer look at it later when I get some spare time, if
nobody else wants to do it.

Regards,
  Bjorn


More information about the Zope3-dev mailing list