[Zope-CMF] Localizer in CMF/Plone problem

Roger Oberholtzer roger.oberholtzer@surbrunn.net
Mon, 17 Feb 2003 19:20:00 +0100


On Mon, 17 Feb 2003 10:08:29 -0500
Greg Ward <gward@python.net> wrote:

> On 16 February 2003, Roger Oberholtzer said:
> > However, I cannot access it. Zope complains:
> > 
> > 2003-02-16T22:51:15 ERROR(200) BeforeTraverse Error while invoking
> > hook:"portal_localizer" Traceback (innermost last):  
> > File /home/httpd/Zope/lib/python/ZPublisher/BeforeTraverse.py,
> > line 134, in __call__  File
> > /home/httpd/Zope/lib/python/Products/CMFLocalizer/LocalizerTool.py,
> > line 227, in __call__    (Object: portal_localizer)  File
> > /home/httpd/Zope/lib/python/Products/CMFLocalizer/LocalizerTool.py,
> > line 85, in _get_first_lang    (Object: portal_localizer)  File
> > /home/httpd/Zope/lib/python/Products/Localizer/Accept.py,
> > line 184, in __getitem
> > __
> > AttributeError: 'int' object has no attribute 'split'
> 
> I don't know much about Zope or CMF or Localizer (although I am
> learning), but I know a Python exception when I see one.  That error
> happens when the programmer thought he was doing this:
> 
>   x = "hello there"
>   chunks = x.split(" ")
> 
> but accidentally did this:
> 
>   x = 37
>   chunks = x.split(" ")   # exception raised here -- 37 has no 'split'
>   attr
> 
> (Usually the assignment and error are separated by a function call: that
> is, some bit of code is passing an int where it's supposed to pass a
> string.)
> 
> IOW, it's entirely likely that this is a bug in one of the bits of
> Python code you're dealing with.  In particular, the exact function
> where the exception is being raised is probably not the problem, more
> likely, the code that's *calling* that function is the problem.

Most likely. But this is a product others are using. I would imagine
with the same releases as I am using. Aside from this (and a PHP thing)
all else seems to be working. It may turn out to be a show stopper as I
want to demonstrate a multi-lingual site, including local content.

Any, thanks. I guess I will keep an eye out for other's with the same
problem or wait for an update. (Being a Tcl-er is not helping here...)

> > I thought I was making great progress. But this I do not understand. I
> > see this in Zope's log all through the time I am making the item.
> > There is no complaint to the Zope interface. 
> 
> That's weird.  I also see occasional exceptions in the log that do *not*
> cause 5xx errors to the web client, which is really disturbing.
> 
> > I see in Accept.py, on line 184, the split call is called with two
> > arguments, and everywhere else in the file it has 1. Is this the
> > problem?
> 
> No.  The string 'split()' method can be called with zero, one, or two
> arguments.  See the Python docs for details.
> 
>         Greg
> -- 
> Greg Ward <gward@python.net>                         http://www.gerg.ca/
> Ban the bomb -- save the world for conventional warfare.
> 
> _______________________________________________
> Zope-CMF maillist  -  Zope-CMF@zope.org
> http://mail.zope.org/mailman/listinfo/zope-cmf
> 
> See http://collector.zope.org/CMF for bug reports and feature requests


-- 

Roger Oberholtzer
Sunny Stockholm