Re: [Zope-dev] buildout and broken Cheeseshop download URLs

2008-05-28 Thread Christian Theune
On Tue, May 27, 2008 at 02:31:04PM -0400, Jim Fulton wrote:
 Did you try setting up a download cache and putting it there?  Note that 
 if you had a download cache named foo, you would need to put the tar 
 ball in foo/dist.

 I could and should add code to buildout to deal with situations like  
 this.  I'm not sure when that will happen. :(

What we do in those cases is to:

- add a directory to our buildout like

mybuildout/3rdparty

- add a find-links option to that in buildout

[buildout]
find-links = 3rdparty/

We then add all (egg) downloads that can't be reached otherwise and also put
them into version control.

Christian

-- 
Christian Theune · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 7 · fax +49 345 1229889 1
Zope and Plone consulting and development
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Zope Tests: 4 OK, 1 Failed

2008-05-28 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue May 27 11:00:00 2008 UTC to Wed May 28 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Test failures
-

Subject: FAILED (failures=1) : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Tue May 27 21:10:39 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009619.html


Tests passed OK
---

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Tue May 27 21:04:38 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009615.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue May 27 21:06:09 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009616.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue May 27 21:07:39 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009617.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue May 27 21:09:09 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009618.html

___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Zope Tests: 4 OK, 1 Failed

2008-05-28 Thread Stefan H. Holek

This looks like another case of borken zope.testbrowser. Benji?

Stefan


On 28.05.2008, at 13:00, Zope Tests Summarizer wrote:


Test failures
-

Subject: FAILED (failures=1) : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Tue May 27 21:10:39 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-May/009619.html


--
Stefan H. Holek
[EMAIL PROTECTED]




___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Zope Tests: 4 OK, 1 Failed

2008-05-28 Thread Benji York
On Wed, May 28, 2008 at 8:32 AM, Stefan H. Holek [EMAIL PROTECTED] wrote:
 This looks like another case of borken zope.testbrowser. Benji?

Looks like a known (and fixed) bug in 3.4.1.  3.4.2 includes a fix.  I
haven't looked at Zope 2 in so long I can't even tell what version
it's using or where to change it.  The tests in question are at a
higher test level, so whoever updates the version should run the tests
with --all before committing.
-- 
Benji York
Senior Software Engineer
Zope Corporation
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] buildout and broken Cheeseshop download URLs

2008-05-28 Thread Jens Vagelpohl


On May 28, 2008, at 02:25 , Christian Theune wrote:


On Tue, May 27, 2008 at 02:31:04PM -0400, Jim Fulton wrote:
Did you try setting up a download cache and putting it there?  Note  
that
if you had a download cache named foo, you would need to put the  
tar

ball in foo/dist.

I could and should add code to buildout to deal with situations like
this.  I'm not sure when that will happen. :(


What we do in those cases is to:

- add a directory to our buildout like

   mybuildout/3rdparty

- add a find-links option to that in buildout

   [buildout]
   find-links = 3rdparty/

We then add all (egg) downloads that can't be reached otherwise and  
also put

them into version control.


Thanks Christian, this appears to work.

jens



___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Status of Better XML support for Page Templates?

2008-05-28 Thread Paul Winkler
Was any action ever taken on this?
http://wiki.zope.org/zope3/BetterXMLSupportForPageTemplates

I never even realized until today that all my browser:page templates
are apparently loaded in HTML mode.
(Tested in Zope 2.9.9 / Five 1.4.2 )

-- 
http://www.slinkp.com
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


Re: [Zope-dev] Status of Better XML support for Page Templates?

2008-05-28 Thread Fred Drake
On Wed, May 28, 2008 at 3:40 PM, Paul Winkler [EMAIL PROTECTED] wrote:
 Was any action ever taken on this?
 http://wiki.zope.org/zope3/BetterXMLSupportForPageTemplates

There's an old Zope 3 branch from before the split of the codebase
into separate projects:


http://svn.zope.org/Zope3/branches/fdrake-anguenot_better_xml_support_for_pt/

I'd be glad to see work on that continue, though I don't expect to
have any time to help out myself at this point.


 -Fred

-- 
Fred L. Drake, Jr. fdrake at gmail.com
Chaos is the score upon which reality is written. --Henry Miller
___
Zope-Dev maillist  -  Zope-Dev@zope.org
http://mail.zope.org/mailman/listinfo/zope-dev
**  No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope )


[Zope-dev] Re: zope.sqlalchemy, integration ideas

2008-05-28 Thread Laurence Rowe

Martijn Faassen wrote:

Laurence Rowe wrote:
We need to differentiate between the interface for session 
configuration and session usage from an application.


Session configuration? I'm talking about engine configuration. A session 
doesn't need to be configured, except with a session, I think, which the 
ScopedSession machinery allows you to do. If you can make the engine be 
the right one in the appropriate context it should only be a matter of 
configuring the session in that context.


For session usage I think it is fairly simple. We should define an 
ISessionContext interface such that:



class ISessionContext(Interface):
def __call__():
return a session in this context

A future version of collective.lead could implement an ISessionContext. 


Client code however should have a cleaner interface, a plain ISession. 
This is accessed through a lookup on the context, translated into a 
simple adapter:


def session_adapter(context):
session_context = queryUtility(ISessionContext, context=context, 
default=None)

if session_context is not None:
return session_context()




This will allow application code to do something like:

session = ISession(context)
ob = session.query(MyClass)


I don't understand what the point of doing this is.

What is 'context' here? Why am I adapting context? My context is 
normally thread-local and implicit. This has been the way to approach 
context in Zope 3 for a long time now (though explicit context can still 
be passed through getUtility it's rarely done).


And again, I think *engine* should be in context, not sessions. 
ScopedSession, a standard SQLAlchemy mechanism, should be used for 
session context-specific session access.


Why the introduction of ISessionContext and ISession interfaces, and an 
adapter lookup that looks up a utility and then *still* I haven't seen 
the code that actually configures the engine? My aim was to try to stick 
to SQLAlchemy patterns for solving this problem where we had no reason 
to diverge from them, and our use case, I take it, is what ScopedSession 
was designed for.


[snip]
session.remove() is not important, sessions are closed by the 
zope.sqlalchemy datamanager and closed sessions are recyclable. 


That's good to seee confirmed. I thought it was that way reading the 
code, but I wanted to make sure.


Presumably the session object would be referred to by a volatile 
attribute on the local utility and the session would be GC'd along 
with the local utility object itself.


Are you talking about a persistent local utility? Which one? Would this 
mean that the session needs to be re-created each time the ZODB swaps 
out the object with the volatile attribute? I thought the session was 
intended to be recreated each request, does it make any sense to cache 
them between requests?


Table creation is another matter that I don't think too important. 


I think it's important to get it right for Grok. We're using the 
declarative extension and still want to support hand-created tables as 
well. There are various scenarios surrounding table creation, either not 
doing it at all ever, or spelling them out by hand in Python, or by 
inlining them into the classes as with the declarative extension.


Implicit creation of tables seems wrong, instead tables should only be 
created explicitly, by the use clicking a button in the zope web 
interface (or automatically on adding an application).


Automatic on adding an application is a good point to do it, as that way 
we don't bother the person who creates the application too much (first 
create the database.. then install the application, then go to this 
screen and create the tables).


There's another feature to automatic table creation though: when I'm 
developing and I don't care about the data yet, all I need to do now 
when I change the schema is throw away the database and create it again. 
 I found this very convenient while developing with collective.lead. We 
need to have something that is at least as convenient for this use case 
(common during initial development).


An exception to this is sqlalchemy in memory databases, which must be 
created on first access.


Don't know what these are?


Those with a url like 'sqlite://:memory:'

Session configuration would be somewhat similar to collective.lead 
currently (registering one as a local utility).


Before we talk more about session configuration, please explain why 
we're not talking about engine configuration. :)


Engine configuration is a subset of session configuration. You cannot 
have a single ScopedSession for a package if you want to have multiple 
instances of that application. We must work with unbound metadata if we 
have this goal. That implies that we must use bound sessions, a session 
associated with a particular engine (actually it could be more complex 
than this, you can associate particular classes/tables with particular 
engines within a session).


The simplest way to achieve 

[Zope] buildout for plone2.5: paster creates bad zcml

2008-05-28 Thread robert rottermann

Hi there,
I try to use paster for a plone 2.5 site.

this is what I have done:

paster create -t plone2.5_buildout plone2
executed bootstrap and buildout
then in src:
paster create -t plone2.5_theme x.y

which I added to the buildout.cfg like so:
[buildout]
...
eggs =
   elementtree
   x.y

develop =
   src/x.y

...
[instance]
...
zcml =
   x.y


when I then start the new instance, I get the following error:
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
/home/zope/plone2/parts/instance/etc/site.zcml, line 11.2-11.55
   ZopeXMLConfigurationError: File 
/home/zope/plone2/parts/instance/etc/package-includes/001-x.y-configure.zcml, 
line 1.0-1.47
   ZopeXMLConfigurationError: File 
/home/zope/plone2/src/x.y/x/y/configure.zcml, line 8.2
   ConfigurationError: ('Unknown directive', 
u'http://namespaces.zope.org/five', u'registerPackage')


what can I do to fix this?
thanks
robert
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] buildout for plone2.5: paster creates bad zcml

2008-05-28 Thread robert rottermann

for the record:
I found a way to fix this by using a newer five versin.
I added:
urls =
   http://codespeak.net/z3/five/release/Five-1.4.4.tgz
in the buildout.cfg.

it would be much nicer, to have the buildout recipes fixed

robert

robert rottermann schrieb:

Hi there,
I try to use paster for a plone 2.5 site.

this is what I have done:

paster create -t plone2.5_buildout plone2
executed bootstrap and buildout
then in src:
paster create -t plone2.5_theme x.y

which I added to the buildout.cfg like so:
[buildout]
...
eggs =
   elementtree
   x.y

develop =
   src/x.y

...
[instance]
...
zcml =
   x.y


when I then start the new instance, I get the following error:
zope.configuration.xmlconfig.ZopeXMLConfigurationError: File 
/home/zope/plone2/parts/instance/etc/site.zcml, line 11.2-11.55
   ZopeXMLConfigurationError: File 
/home/zope/plone2/parts/instance/etc/package-includes/001-x.y-configure.zcml, 
line 1.0-1.47
   ZopeXMLConfigurationError: File 
/home/zope/plone2/src/x.y/x/y/configure.zcml, line 8.2
   ConfigurationError: ('Unknown directive', 
u'http://namespaces.zope.org/five', u'registerPackage')


what can I do to fix this?
thanks
robert
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - http://mail.zope.org/mailman/listinfo/zope-announce
http://mail.zope.org/mailman/listinfo/zope-dev )



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Saving PIL Images on zope

2008-05-28 Thread Gaurav Girotra
I am using Plone3 and zope 2.10,
I need to save PIL images generated through MatplotLib Graphs using External
Methods to my zope site

I have used  addImage(self,'%s' % img_id, title = '%s' % img_id,
file=image_data.getvalue() )
which adds image as a content type and also on the current context

Is there any other way to save images on my local zope site?
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] saving PIL Images

2008-05-28 Thread Andreas Jung



--On 28. Mai 2008 15:01:56 +0530 Gaurav Girotra [EMAIL PROTECTED] wrote:



Can anyone Help me in saving images to the file system.



Pretty easy: fix your file permissions. If your zope process should
write to the filesystem then the directory must be writable.

-aj

pgpMbn5l12xbZ.pgp
Description: PGP signature
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] saving PIL Images

2008-05-28 Thread Peter Bengtsson
2008/5/28 Gaurav Girotra [EMAIL PROTECTED]:
 Hello

 I am using Plone3 and zope 2.10,
 I need to save images generated through MatplotLib Graphs using External
 Methods to my zope site or to my linux file system.

 When i try to save using im.save(/zope/zeocluster/Extemsions)

Been a while but doesn't im.save() expect a filename?

 folder i get Permission denied error.

 Can anyone Help me in saving images to the file system.

 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )





-- 
Peter Bengtsson,
work www.fry-it.com
home www.peterbe.com
hobby www.issuetrackerproduct.com
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] saving PIL Images

2008-05-28 Thread Gaurav Girotra
Hello

I am using Plone3 and zope 2.10,
I need to save images generated through MatplotLib Graphs using External
Methods to my zope site or to my linux file system.

When i try to save using im.save(/zope/zeocluster/Extemsions)
folder i get Permission denied error.

Can anyone Help me in saving images to the file system.
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Multithreading sessions

2008-05-28 Thread Jon Emmons
Jens,

Thanks for your input.

Unfortunately, I am out of the office this week.  When I return I will be
trying to resolve this issue.

I don't believe it has squat to do with my Database at all, so I will be
setting up some scenarios where I am making simultaneous requests, requiring
no DB access.

I will echo the data to my screen, hopefully I will see an interwoven jumble
of characters as my web server is sending text simultaneously to multiple
clients.

If I don't see an interwoven jumble of stuff representing the various
threads, then my problem is more fundamental than DB contention.

I appreciate everyone's help.

Jon Emmons



On Fri, May 23, 2008 at 1:55 PM, Andreas Jung [EMAIL PROTECTED] wrote:



 --On 23. Mai 2008 12:31:50 -0500 Jens Vagelpohl [EMAIL PROTECTED]
 wrote:


 On May 23, 2008, at 11:49 , Jon Emmons wrote:

 Another thought I had, is that Zope has only one python interpreter
 running,
 pretty much forcing all processing to be serial by default given
 what you've
 just said.


 Sorry, that's all baloney. Just like blindly hiking the number of threads
 or the ZODB database connection pool size. Zope can handle more than one
 concurrent request.

 I would take a close look at the Zope database adapter for your
 relational database you are using. Some are not thread-enabled and will
 serialize database access.


 Not much to be added. Either your backend server blocks further requests
 (as indicated earlier by a database lock) or some extension module is
 holding the GIL. We have seen situation where Python did not perform a
 thread switch while working on a complex regular expression operation in one
 thread (preventing a thread switch over ten seconds and longer).

 Andreas
 ___
 Zope maillist  -  Zope@zope.org
 http://mail.zope.org/mailman/listinfo/zope
 **   No cross posts or HTML encoding!  **
 (Related lists -
  http://mail.zope.org/mailman/listinfo/zope-announce
  http://mail.zope.org/mailman/listinfo/zope-dev )


___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] Multithreading sessions

2008-05-28 Thread Dieter Maurer
Jon Emmons wrote at 2008-5-23 08:58 -0400:
 ...
I am running zope 2.9.4 and have observed that it will not simultaneously
serve pages to my users.

Usually, it does.

I have seen database adapter packages (an old psycopg version, to be
precise) that forgot to release the GIL for some operations.
Then Zope freezes while these operations are executed.


A surprising report of a similar kind was: while Zope's embedded
profiler is in use, Zope effectively runs in single thread mode (such
that other threads do not distort the timing results).
Probably not your problem ... but who knows.


Further potential reasons (for almost surely not responsible for your
current problem:

  Expensive operations implemented in C (such as operations on huge
  strings)

  Creating excessive amounts of objects (causing lots
  of generation 2 garbage collections which hold the GIL)



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] PageTemplates len() of unsized object

2008-05-28 Thread Dieter Maurer
Giampiero Benvenuti wrote at 2008-5-24 11:47 +0200:
 ...
after the upgrade from zope2.9.7 to 2.10.6 i get this error in the  
event log:

2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main
Traceback (innermost last):
   Module ZPublisher.Publish, line 119, in publish
   Module ZPublisher.mapply, line 88, in mapply
   Module ZPublisher.Publish, line 42, in call_object
   Module Shared.DC.Scripts.Bindings, line 313, in __call__
   Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
   Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
   Module Products.PageTemplates.PageTemplate, line 89, in pt_render
   Module zope.pagetemplate.pagetemplate, line 117, in pt_render
   Module zope.tal.talinterpreter, line 271, in __call__
   Module zope.tal.talinterpreter, line 346, in interpret
   Module zope.tal.talinterpreter, line 379, in do_startEndTag
   Module zope.tal.talinterpreter, line 412, in do_startTag
TypeError: len() of unsized object

Looks as if the Zope 2.10 PageTemplate implementation made a big
step backward with respect to quality of traceback information :-((

Shane had added lots of __traceback_info__ and __traceback_supplement__
declarations to the older code such that the tracebacks were
very informative
... unlike the traceback above.


Looking at the code of do_startTag, I see that the problem is
with an attribute definition in a start tag.
Such an attribute definition should be evaluated into a sequence of strings
(or unicode strings).
The error happens because one of these sequence elements is
not a string, more precisely, it is something len(...) cannot be applied to.


Unfortunately, we would need to know the affected template,
the template line this problems occurs in (and its code)
and the attribute causing this problem.
It would be Zope's task to provide this information -- but as I have said:
it apparently made big steps backward with Zope 2.10


You could try to add

__traceback_info__ = name, item, rendered, s

before line 412 of zope/tal/talinterpreter.py.

The traceback would then tell us: the name of the tag (name),
the attribute definition (item), its evaluation (rendered)
and the problematic element.

We still would not know which PageTemplate causes the problem (but
we might guess this).



-- 
Dieter
___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
 http://mail.zope.org/mailman/listinfo/zope-announce
 http://mail.zope.org/mailman/listinfo/zope-dev )


Re: [Zope] PageTemplates len() of unsized object

2008-05-28 Thread Giampiero Benvenuti

Thanks Dieter,

I was able to solve the problem by uninstalling all the products. By  
trial and error I found out the problem was caused by the Placeless  
Translation Service product. Maybe there was some dependency from  
something else; I can't tell. I just got rid of it and now everything  
works as normal.


Thanks anyhow,

Giampiero


On May 28, 2008, at 8:48 PM, Dieter Maurer wrote:


Giampiero Benvenuti wrote at 2008-5-24 11:47 +0200:

...
after the upgrade from zope2.9.7 to 2.10.6 i get this error in the
event log:

2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main
Traceback (innermost last):
 Module ZPublisher.Publish, line 119, in publish
 Module ZPublisher.mapply, line 88, in mapply
 Module ZPublisher.Publish, line 42, in call_object
 Module Shared.DC.Scripts.Bindings, line 313, in __call__
 Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
 Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
 Module Products.PageTemplates.PageTemplate, line 89, in pt_render
 Module zope.pagetemplate.pagetemplate, line 117, in pt_render
 Module zope.tal.talinterpreter, line 271, in __call__
 Module zope.tal.talinterpreter, line 346, in interpret
 Module zope.tal.talinterpreter, line 379, in do_startEndTag
 Module zope.tal.talinterpreter, line 412, in do_startTag
TypeError: len() of unsized object


Looks as if the Zope 2.10 PageTemplate implementation made a big
step backward with respect to quality of traceback information :-((

Shane had added lots of __traceback_info__ and  
__traceback_supplement__

declarations to the older code such that the tracebacks were
very informative
... unlike the traceback above.


Looking at the code of do_startTag, I see that the problem is
with an attribute definition in a start tag.
Such an attribute definition should be evaluated into a sequence of  
strings

(or unicode strings).
The error happens because one of these sequence elements is
not a string, more precisely, it is something len(...) cannot be  
applied to.



Unfortunately, we would need to know the affected template,
the template line this problems occurs in (and its code)
and the attribute causing this problem.
It would be Zope's task to provide this information -- but as I have  
said:

it apparently made big steps backward with Zope 2.10


You could try to add

   __traceback_info__ = name, item, rendered, s

before line 412 of zope/tal/talinterpreter.py.

The traceback would then tell us: the name of the tag (name),
the attribute definition (item), its evaluation (rendered)
and the problematic element.

We still would not know which PageTemplate causes the problem (but
we might guess this).



--
Dieter



___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )


[Zope] Re: PageTemplates len() of unsized object

2008-05-28 Thread Philipp von Weitershausen

Dieter Maurer wrote:

Giampiero Benvenuti wrote at 2008-5-24 11:47 +0200:

...
after the upgrade from zope2.9.7 to 2.10.6 i get this error in the  
event log:


2008-05-24T09:31:32 ERROR Zope.SiteErrorLog http://myurl/error_log/manage_main
Traceback (innermost last):
  Module ZPublisher.Publish, line 119, in publish
  Module ZPublisher.mapply, line 88, in mapply
  Module ZPublisher.Publish, line 42, in call_object
  Module Shared.DC.Scripts.Bindings, line 313, in __call__
  Module Shared.DC.Scripts.Bindings, line 350, in _bindAndExec
  Module Products.PageTemplates.PageTemplateFile, line 129, in _exec
  Module Products.PageTemplates.PageTemplate, line 89, in pt_render
  Module zope.pagetemplate.pagetemplate, line 117, in pt_render
  Module zope.tal.talinterpreter, line 271, in __call__
  Module zope.tal.talinterpreter, line 346, in interpret
  Module zope.tal.talinterpreter, line 379, in do_startEndTag
  Module zope.tal.talinterpreter, line 412, in do_startTag
TypeError: len() of unsized object


Looks as if the Zope 2.10 PageTemplate implementation made a big
step backward with respect to quality of traceback information :-((


As far as I can see, traceback information was never added within the 
TAL interpreter but always for TALES expression evalutation. The 
traceback above seems to be about something going wrong within the TAL 
interpreter which is probably why we don't see any further traceback info.



Shane had added lots of __traceback_info__ and __traceback_supplement__
declarations to the older code such that the tracebacks were
very informative
... unlike the traceback above.


As far as I can tell, the code in zope.pagetemplate and zope.tales still 
has the same traceback information that Products.PageTemplate had. 
zope.tal, which contains the TAL interpreter, doesn't have any traceback 
supplements, but then again, Zope 2's TAL package doesn't either.


To conclude, I don't think there's a step backward at all.

___
Zope maillist  -  Zope@zope.org
http://mail.zope.org/mailman/listinfo/zope
**   No cross posts or HTML encoding!  **
(Related lists - 
http://mail.zope.org/mailman/listinfo/zope-announce

http://mail.zope.org/mailman/listinfo/zope-dev )