Re: [Zope-dev] traversal: different with and without a request

2008-10-17 Thread Philipp von Weitershausen
El 17 Oct 2008, a las 10:37 , Christian Theune escribió:
 There is a process that actually needs the request and this process  
 is
 what I call traversal: breaking down a URL and finding a publishable
 object. zope.traversing has (almost) nothing to do with it, the real
 kind of traversal happens in the publisher and facilitates
 IPublishTraverse adapters (rather than ITraversable). The only case  
 when
 the two kinds of traversal are intermingled is when ++namespaces+ 
 + are
 involved. Then IPublishTraverse-style traversal uses ITraversable
 adapters. This has long been considered a mistake but was never  
 fixed.

 URL traversal makes use of zope.traversing though.

Yes, but only in the special case of ++namespace++ traversal. This is  
what I said in the above paragraph already. zope.publisher itself  
doesn't depend on zope.traversing and the default publication  
implementation in zope.app.publication uses zope.traversing only for + 
+namespace++ names (see usage of zope.traversing.namespace.nsParse in  
zope 
.app.publication.publicationtraverse.PublicationTraverse.traverseName).

___
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: 5 OK

2008-10-17 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Thu Oct 16 11:00:00 2008 UTC to Fri Oct 17 11:00:00 2008 UTC.
There were 5 messages: 5 from Zope Tests.


Tests passed OK
---

Subject: OK : Zope-2.8 Python-2.3.6 : Linux
From: Zope Tests
Date: Thu Oct 16 20:50:58 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010325.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu Oct 16 20:52:28 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010326.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu Oct 16 20:53:59 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010327.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Thu Oct 16 20:55:29 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010328.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Thu Oct 16 20:56:59 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010329.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] traversal: different with and without a request

2008-10-17 Thread Jim Fulton

On Oct 15, 2008, at 12:02 PM, Philipp von Weitershausen wrote:

 Christian Theune wrote:
 we stumbled over an annoyance that took a while to debug:

 Writing an ITraversable, we used zope.traversing.api.traverse() in a
 test to verify our code. We registered the ITraversable as an
 (non-multi) adapter and ended up with a working test.

 In the actual system, we found that the traversable would not be  
 used.
 After investigation we found a conditional branch in the traverse()
 function which would look for a multi-adapter if a request was  
 around,
 and a regular adapter if not.

 We didn't anticipate this difference and it cost us some time, so we
 wonder whether this has to be the way it is, or whether this could be
 changed to behave more obvious and consistent.

 zope.traversing is a mess.

That's a bit strong, but essentially true.  It zope.traversing  
deserves to be reworked if anyone has the time and energy.


 First of all, its name is quite misleading.  It should really be  
 called
 'zope.resolvepath' because it resolves TALES-like object paths. In  
 fact,
 it's pretty much only used by the PageTemplate machinery to hook it up
 to the TALES engine (with one exception, see below).

Historical note. Until we decided to use the location framework and  
eschew traversal proxies, is was much more widely used.

It would be nice to deprecate zope.traversing and fold it into  
zope.app.pagetemplate.

 The request
 shouldn't really be necessary for this kind of path resolution, I  
 think.

It's needed for looking up views and resources, both of which are  
commonly looked up in ZPT.

 The conditional multi-adaption sounds like a DWIM feature that I would
 consider one of our many mistakes that we made in the beginnings of  
 our
 using the Component Architecture.

shrug /

I'll note that the fix, in the context of ZPT is to always to a multi- 
adapter lookup using the request.


 There is a process that actually needs the request and this process is
 what I call traversal: breaking down a URL and finding a publishable
 object. zope.traversing has (almost) nothing to do with it, the real
 kind of traversal happens in the publisher and facilitates
 IPublishTraverse adapters (rather than ITraversable).

Yup.

 The only case when
 the two kinds of traversal are intermingled is when ++namespaces++  
 are
 involved. Then IPublishTraverse-style traversal uses ITraversable
 adapters. This has long been considered a mistake but was never fixed.

Yup.  I would go so far as to call it a bug. Somebody please fix it. :)

Jim

--
Jim Fulton
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] traversal: different with and without a request

2008-10-17 Thread Philipp von Weitershausen
El 17 Oct 2008, a las 15:02 , Jim Fulton escribió:
 First of all, its name is quite misleading.  It should really be  
 called
 'zope.resolvepath' because it resolves TALES-like object paths. In  
 fact,
 it's pretty much only used by the PageTemplate machinery to hook it  
 up
 to the TALES engine (with one exception, see below).

 Historical note. Until we decided to use the location framework and  
 eschew traversal proxies, is was much more widely used.

 It would be nice to deprecate zope.traversing and fold it into  
 zope.app.pagetemplate.

+1

 The request shouldn't really be necessary for this kind of path  
 resolution, I think.

 It's needed for looking up views and resources, both of which are  
 commonly looked up in ZPT.

Yeah, I forgot about that.

 The conditional multi-adaption sounds like a DWIM feature that I  
 would
 consider one of our many mistakes that we made in the beginnings of  
 our
 using the Component Architecture.

 shrug /

 I'll note that the fix, in the context of ZPT is to always to a  
 multi-adapter lookup using the request.

Right. I'm fine with it always being a multi-adapter look-up.

___
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] ForbiddenAttribute: why subclass AttributeError?

2008-10-17 Thread Christian Zagrodnick
On 2008-10-15 17:49:30 +0200, Christian Theune [EMAIL PROTECTED] said:

 
 Why is a ForbiddenAttribute also an AttributeError? Is this intended to
 avoid 'information leaks'?
 
 We found a nasty side-effect together with getattr and annotations: a
 user that didn't have read-access to __annotations__ would end up trying
 to create the annotations container again and again because getattr(obj
 '__annotations__', None) would return None instead of propagating the
 ForbiddenAttribute exception.

On a proxied object you'd never get an AttributeError but only 
ForbidenAttribute, wouldn't you? So I think an ForbiddenAttribute as 
subclass of AttributeError is the right thing.


-- 
Christian Zagrodnick · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · 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.testbrowser: Newlines in textarea not always preserved

2008-10-17 Thread Christian Zagrodnick
Hi,

a few weeks ago I posted a bug regarding zope.testbrowser: 
https://bugs.launchpad.net/zope3/+bug/268139

»When there is XML or HTML-Code in the Textarea the newlines are removed.«
Could anybody give me a hint how to fix it? I'd really apprechiate it 
because it prevents me from using Python 2.5 :)

Regards,
-- 
Christian Zagrodnick · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 4 · 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] Double usage of vocabulary in z3c.form seems to fail

2008-10-17 Thread Hermann Himmelbauer
Hi,
I currently have two schema.Choice() fields in my z3c.form - based form, that 
references the same vocabulary. 

runjobs = Choice(
title = u'Job',
vocabulary=('cronjobsVocabulary'),
required = False)
cronjobs = Choice(
title = u'Periodic Jobs',
vocabulary=('cronjobsVocabulary'),
required = False)

However, when trying to get data from this field in my ActionHandler, strange 
things happen: It seems that one choice field conflicts with the other, 
especially it seems, that only one field is used.

Any clue why?

How can I solve that - perhaps I should register the same vocabulary a second 
time under a different name?

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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] SVN: ZODB/trunk/buildout.cfg Changed the generated test script to use a part-local tmp directory

2008-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Jim Fulton wrote:
 Log message for revision 92293:
   Changed the generated test script to use a part-local tmp directory
   that is cleaned up at the start of a test run.
   
   Unfortunately, the ZODB tests leave lots of temporary files behind
   which can cause failures in subsequent test runs and which tend to
   litter /tmp. Eventually, I want to clean that up, but, in the mean
   time, I can limit the damage to the test part directory.
   
 
 Changed:
   U   ZODB/trunk/buildout.cfg
 
 -=-
 Modified: ZODB/trunk/buildout.cfg
 ===
 --- ZODB/trunk/buildout.cfg   2008-10-17 12:46:34 UTC (rev 92292)
 +++ ZODB/trunk/buildout.cfg   2008-10-17 14:02:39 UTC (rev 92293)
 @@ -6,6 +6,11 @@
  [test]
  recipe = zc.recipe.testrunner
  eggs = ZODB3
 +initialization = 
 +  import os, tempfile, shutil
 +  if os.path.exists('tmp'): shutil.rmtree('tmp')
 +  os.mkdir('tmp')
 +  tempfile.tempdir = os.path.abspath('tmp')
  
  [scripts]
  recipe = zc.recipe.egg

Maybe zc.recipe.testrunner could add support for a 'finalization' or
'cleanup' argument which would do the same think as the 'initialization'
(or maybe only if there were no failures?)


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+L+Y+gerLs4ltQ4RAgtjAKClCd+fCX0zjCPZD944HDJ/Tp2ZxwCgmVHM
0IMF4ykSw9OKP0ICgwPCNfg=
=+qlo
-END PGP SIGNATURE-

___
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] SVN: ZODB/trunk/buildout.cfg Changed the generated test script to use a part-local tmp directory

2008-10-17 Thread Jim Fulton

On Oct 17, 2008, at 12:38 PM, Tres Seaver wrote:

 -BEGIN PGP SIGNED MESSAGE-
 Hash: SHA1

 Jim Fulton wrote:
 Log message for revision 92293:
  Changed the generated test script to use a part-local tmp directory
  that is cleaned up at the start of a test run.

  Unfortunately, the ZODB tests leave lots of temporary files behind
  which can cause failures in subsequent test runs and which tend to
  litter /tmp. Eventually, I want to clean that up, but, in the mean
  time, I can limit the damage to the test part directory.


 Changed:
  U   ZODB/trunk/buildout.cfg

 -=-
 Modified: ZODB/trunk/buildout.cfg
 ===
 --- ZODB/trunk/buildout.cfg  2008-10-17 12:46:34 UTC (rev 92292)
 +++ ZODB/trunk/buildout.cfg  2008-10-17 14:02:39 UTC (rev 92293)
 @@ -6,6 +6,11 @@
 [test]
 recipe = zc.recipe.testrunner
 eggs = ZODB3
 +initialization =
 +  import os, tempfile, shutil
 +  if os.path.exists('tmp'): shutil.rmtree('tmp')
 +  os.mkdir('tmp')
 +  tempfile.tempdir = os.path.abspath('tmp')

 [scripts]
 recipe = zc.recipe.egg

 Maybe zc.recipe.testrunner could add support for a 'finalization' or
 'cleanup' argument which would do the same think as the  
 'initialization'
 (or maybe only if there were no failures?)


Yup.  That would be good. In the mean time ... :)

It would also be good to have some automated way to check for leaving  
temp files behind, much as it now checks for leaving threads behind.

I've got a significant project ahead to fix the ZODB tests to be less  
sloppy about the way they manage files, although this initializer hack  
buys me some time. :)

Jim

--
Jim Fulton
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] SVN: z3c.relationfield/trunk/buildout.cfg zope.testing somehow doesn't upgrade without hardcoding it. I don't know

2008-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Martijn Faassen wrote:
 Log message for revision 92303:
   zope.testing somehow doesn't upgrade without hardcoding it. I don't know
   why I keep running into it, but I am running into it absolutely all over
   the place.

There is a newer release of zope.testing (3.7.0);  perhaps that is part
of the problem?


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+MBx+gerLs4ltQ4RAkwVAJ9vVt/OHO1JEh5g/s6gg6KSPbmIaQCfT8Z1
vVI56/ce+ezcZMzYXZgekFM=
=Yycp
-END PGP SIGNATURE-

___
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] traversal: different with and without a request

2008-10-17 Thread Stephan Richter
On Friday 17 October 2008, Jim Fulton wrote:
 It would be nice to deprecate zope.traversing and fold it into  
 zope.app.pagetemplate.

Just skimming the thread, wouldn't this make it harder for us to integrate 
z3c.pt, which also needs those traversal APIs?

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
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] traversal: different with and without a request

2008-10-17 Thread Jim Fulton

On Oct 17, 2008, at 1:13 PM, Stephan Richter wrote:

 On Friday 17 October 2008, Jim Fulton wrote:
 It would be nice to deprecate zope.traversing and fold it into
 zope.app.pagetemplate.

 Just skimming the thread, wouldn't this make it harder for us to  
 integrate
 z3c.pt, which also needs those traversal APIs?


Yup. Actually, this wants to be in zope.tales. Does z3c.pt use  
zope.tales?

Jim

--
Jim Fulton
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] zope.interface: verifyObject vs properties

2008-10-17 Thread Dieter Maurer
Christian Theune wrote at 2008-10-16 20:27 +0200:
 ...
Then again, verifyObject is a *very* light way to spot simple errors.
IMHO attributes and methods aren't that different in Python, as using
both may result in exceptions.

Using attributes (not computed one) does not result in exceptions.

However, implementing a method of an interface doesn't check whether the
method actually executes correctly -- only whether an implementation is
present.

Of course, it does not -- because (in general) there is not a single 
call which would need to be checked but usually an unlimited number
of calls.

One may argue that a parameterless method is very similar to
an attribute (Eiffel does this), but this is not the case in Python.

Arguably, the check for an attribute would be sufficient if it checked
whether an attribute implementation is around -- either by a simple
attribute value or a descriptor providing that.

Of course one can argue: Gocept argues for it and I argue against it.

There's another method: verifyClass. This definitely only checks the
presence of an implementation. 

It only checks methods and ignores everything else.

For methods, it uses the same getattr as verifyObject does
(in fact, both are implemented by the same function).
And if the attribute is implemented by a property (of the class, i.e.
the decriptor is on the metaclass), then the descriptors __get__
is called (in the same way as for verifyObject).
Instance properties (descriptor on the class) may not define methods
(probably a bug).



-- 
Dieter
___
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.interface: verifyObject vs properties

2008-10-17 Thread Thomas Lotze
Dieter Maurer [EMAIL PROTECTED] schrieb:

 And if the attribute is implemented by a property (of the class, i.e.
 the decriptor is on the metaclass), then the descriptors __get__
 is called (in the same way as for verifyObject).
 Instance properties (descriptor on the class) may not define methods
 (probably a bug).

I don't understand what you're saying in that last sentence; can you
elaborate?

Viele Grüße,
Thomas

-- 
Thomas Lotze · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: PGP signature
___
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.interface: verifyObject vs properties

2008-10-17 Thread Dieter Maurer
Thomas Lotze wrote at 2008-10-16 20:57 +0200:
Christian Theune [EMAIL PROTECTED] wrote:

 Arguably, the check for an attribute would be sufficient if it checked
 whether an attribute implementation is around -- either by a simple
 attribute value or a descriptor providing that.

At this point, I guess the outcome of the discussion depends on whether
it is considered legal or abuse to implement a data descriptor in such
a way that it hides an attribute defined on a base class by raising an
AttributeError.

That is only one extreme case.

Instead, the discussion outcome depends on whether an attribute
is considered to be there when the descriptor raises an exception.
As the attribute is not accessible in this case, I argue that
it is not there: in this case, it does not have the wrong value, it
has no value at all...

 There's another method: verifyClass. This definitely only checks the
 presence of an implementation. 

To be more precise: the declaration of implementation of an interface
as opposed to actual implementation of its attributes.

 Thomas: There is an issue that we regularly see with verifyClass that
 makes us instanciated the objects and then use verifyObject. I don't
 remember what it was right now. Do you?

Not really, other than to avoid the case of a happy verifyClass() call
with the application dying of a forgotten attribute implementation.
Could there be classes we subclass that claim to implement an interface
but don't fully do so until after instantiation? Just a guess...

Indeed: as Python lacks a means to define instance attributes on the class,
the presence of attributes can (reliably) only be checked on instances.



-- 
Dieter
___
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.interface: verifyObject vs properties

2008-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dieter Maurer wrote:
 Thomas Lotze wrote at 2008-10-16 20:57 +0200:
 Christian Theune [EMAIL PROTECTED] wrote:

 Arguably, the check for an attribute would be sufficient if it checked
 whether an attribute implementation is around -- either by a simple
 attribute value or a descriptor providing that.
 At this point, I guess the outcome of the discussion depends on whether
 it is considered legal or abuse to implement a data descriptor in such
 a way that it hides an attribute defined on a base class by raising an
 AttributeError.
 
 That is only one extreme case.
 
 Instead, the discussion outcome depends on whether an attribute
 is considered to be there when the descriptor raises an exception.
 As the attribute is not accessible in this case, I argue that
 it is not there: in this case, it does not have the wrong value, it
 has no value at all...

+1.  A descriptor which raises AttributeError *denies* the existence of
the attribute, period:  if the contract / interface requires that the
attribute exist, then such a descriptor violates the contract (under
whatever circumstances it raises the error).

The choice then becomes:

 - Satisfy the contract, e.g. by updating the descriptor to return some
   appropriate default in the cases where it now raises AttributeError.

 - Relax the contract by removing the attribute from the interface.

In either case, 'verifyClass' and 'verifyObject' will behave as
expected, without changes.



Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+N5v+gerLs4ltQ4RAqqEAJ440ALN/9seugX+jiayKhv6htLFRQCgvw06
nyzQaM/HA/m8j7Mxd0FmXTM=
=rgCs
-END PGP SIGNATURE-

___
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.interface: verifyObject vs properties

2008-10-17 Thread Dieter Maurer
Thomas Lotze wrote at 2008-10-17 19:42 +0200:
Dieter Maurer [EMAIL PROTECTED] schrieb:
 ...
 Instance properties (descriptor on the class) may not define methods
 (probably a bug).

I don't understand what you're saying in that last sentence; can you
elaborate?

verifyObject/verifyClass is likely not to handle the following
case correctly:

 class I(Interface):
   def m(...):
 ...

 class C(object):
   implements(I)
   m = property(lambda self: lambda ...: ...)


i.e. when a method (declared by the interface) is implemented by a property.


--
Dieter
___
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] [Checkins] SVN: zope.testing/trunk/ - Open doctest files in universal mode, so that packages released in Windoes

2008-10-17 Thread Jim Fulton

testrunner-coverage.txt is failing since this check in.  What's up  
with this?

Jim

On Aug 27, 2008, at 3:41 AM, Stephan Richter wrote:

 Log message for revision 90401:
  - Open doctest files in universal mode, so that packages released  
 in Windoes
can be tested in Linux, for example.

  - Fixed failing test in testrunner-coverage.txt.
  --This line, and those
  below,
  will be ignored--

  AM   src/zope/testing/doctest.txt
  Msrc/zope/testing/tests.py
  Msrc/zope/testing/doctest.py
  Msrc/zope/testing/testrunner/testrunner-coverage.txt
  MREADME.txt


 Changed:
  U   zope.testing/trunk/README.txt
  U   zope.testing/trunk/src/zope/testing/doctest.py
  A   zope.testing/trunk/src/zope/testing/doctest.txt
  U   zope.testing/trunk/src/zope/testing/testrunner/testrunner- 
 coverage.txt
  U   zope.testing/trunk/src/zope/testing/tests.py

 -=-
 Modified: zope.testing/trunk/README.txt
 ===
 --- zope.testing/trunk/README.txt 2008-08-27 07:27:11 UTC (rev 90400)
 +++ zope.testing/trunk/README.txt 2008-08-27 07:41:00 UTC (rev 90401)
 @@ -63,6 +63,8 @@

 - Fixed NameError in StartUpFailure.

 +- Open doctest files in universal mode, so that packages released  
 in Windoes
 +  can be tested in Linux, for example.


 3.6.0 (2008/07/10)

 Modified: zope.testing/trunk/src/zope/testing/doctest.py
 ===
 --- zope.testing/trunk/src/zope/testing/doctest.py2008-08-27  
 07:27:11 UTC (rev 90400)
 +++ zope.testing/trunk/src/zope/testing/doctest.py2008-08-27  
 07:41:00 UTC (rev 90401)
 @@ -2074,7 +2074,7 @@
 runner = DocTestRunner(verbose=verbose,  
 optionflags=optionflags)

 # Read the file, convert it to a test, and run it.
 -s = open(filename).read()
 +s = open(filename, 'U').read()
 if encoding is None:
 encoding = pep263_encoding(s)
 if encoding is not None:
 @@ -2517,7 +2517,7 @@

 # Find the file and read it.
 name = os.path.basename(path)
 -doc = open(path).read()
 +doc = open(path, 'U').read()

 # If an encoding is specified, use it to convert the file to  
 unicode
 if encoding is None:

 Added: zope.testing/trunk/src/zope/testing/doctest.txt
 ===
 --- zope.testing/trunk/src/zope/testing/ 
 doctest.txt   (rev 0)
 +++ zope.testing/trunk/src/zope/testing/doctest.txt   2008-08-27  
 07:41:00 UTC (rev 90401)
 @@ -0,0 +1,32 @@
 +
 +Additional doctest Tests
 +
 +
 +Most `doctest` module tests are located within the module. This  
 file only
 +tests a few additional features not covered by the module tests, so  
 that the
 +changes to the `doctest` module -- which is forked from the Python  
 stanadrd
 +library -- are minimized.
 +
 +Working with Carriage Returns
 +-
 +
 +Due to the way releases are made on different platforms, we  
 sometimes test
 +files on a *nix system with Windows file endings. Unfortunately,  
 that leaves
 +some the tests broken:
 +
 +   import tempfile
 +   fn = tempfile.mktemp()
 +   open(fn, 'w').write('Test:\r\n\r\n   x = 1 + 1\r\n\r\nDone. 
 \r\n')
 +
 +Let's now run it as a doctest:
 +
 +   from zope.testing import doctest
 +   doctest.testfile(fn, False)
 +  (0, 1)
 +
 +It worked. Let's also try the test file suite:
 +
 +   import unittest
 +   result = unittest.TestResult()
 +   doctest.DocFileSuite(fn, module_relative=False).run(result)
 +  unittest.TestResult run=1 errors=0 failures=0


 Property changes on: zope.testing/trunk/src/zope/testing/doctest.txt
 ___
 Name: svn:eol-style
   + native

 Modified: zope.testing/trunk/src/zope/testing/testrunner/testrunner- 
 coverage.txt
 ===
 --- zope.testing/trunk/src/zope/testing/testrunner/testrunner- 
 coverage.txt  2008-08-27 07:27:11 UTC (rev 90400)
 +++ zope.testing/trunk/src/zope/testing/testrunner/testrunner- 
 coverage.txt  2008-08-27 07:41:00 UTC (rev 90401)
 @@ -52,32 +52,41 @@
 Tearing down left over layers:
   Tear down zope.testing.testrunner.layer.UnitTests in 0.000  
 seconds.
 lines   cov%   module   (path)
 -   8278%   sample1.sample11.sampletests   (testrunner-ex 
 \sample1\sample11\sampletests.py)
 -   5292%   sample1.sample13.sampletests   (testrunner-ex 
 \sample1\sample13\sampletests.py)
 -   5292%   sample1.sampletests.test1   (testrunner-ex 
 \sample1\sampletests\test1.py)
 -   7894%   sample1.sampletests.test11   (testrunner-ex 
 \sample1\sampletests\test11.py)
 -   7894%   sample1.sampletests.test111   (testrunner-ex 
 \sample1\sampletests\test111.py)
 -   7894%   sample1.sampletests.test112   (testrunner-ex 
 \sample1\sampletests\test112.py)
 -   

Re: [Zope-dev] zope.interface: verifyObject vs properties

2008-10-17 Thread Thomas Lotze
Dieter Maurer [EMAIL PROTECTED] schrieb:

 verifyObject/verifyClass is likely not to handle the following
 case correctly:
 
  class I(Interface):
def m(...):
  ...
 
  class C(object):
implements(I)
m = property(lambda self: lambda ...: ...)
 
 
 i.e. when a method (declared by the interface) is implemented by a property.

Ah, I see. Thank you.

Thomas

-- 
Thomas Lotze · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: PGP signature
___
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.interface: verifyObject vs properties

2008-10-17 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Dieter Maurer wrote:
 Thomas Lotze wrote at 2008-10-17 19:42 +0200:
 Dieter Maurer [EMAIL PROTECTED] schrieb:
 ...
 Instance properties (descriptor on the class) may not define methods
 (probably a bug).
 I don't understand what you're saying in that last sentence; can you
 elaborate?
 
 verifyObject/verifyClass is likely not to handle the following
 case correctly:
 
  class I(Interface):
def m(...):
  ...
 
  class C(object):
implements(I)
m = property(lambda self: lambda ...: ...)
 
 
 i.e. when a method (declared by the interface) is implemented by a property.

Why would I want to do that, rather than using 'def m(self):'?


Tres.
- --
===
Tres Seaver  +1 540-429-0999  [EMAIL PROTECTED]
Palladion Software   Excellence by Designhttp://palladion.com
-BEGIN PGP SIGNATURE-
Version: GnuPG v1.4.6 (GNU/Linux)
Comment: Using GnuPG with Mozilla - http://enigmail.mozdev.org

iD8DBQFI+OQK+gerLs4ltQ4RAjhgAJ9hS2kbePps6Ka2yqK8gOF94XOmlgCg1HWc
y/uPVTUWU3e7p6PZROToHLY=
=UCfg
-END PGP SIGNATURE-
___
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] [Checkins] SVN: zope.testing/trunk/ - Open doctest files in universal mode, so that packages released in Windoes

2008-10-17 Thread Stephan Richter
On Friday 17 October 2008, Jim Fulton wrote:
 testrunner-coverage.txt is failing since this check in.  What's up  
 with this?

It passes for me on Python 2.5. Can you be more specific? Are you using a 
ZC-internal set of package versions? :-)

Regards,
Stephan
-- 
Stephan Richter
Web Software Design, Development and Training
Google me. Zope Stephan Richter
___
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] [Checkins] SVN: zope.testing/trunk/ - Open doctest files in universal mode, so that packages released in Windoes

2008-10-17 Thread Jim Fulton

On Oct 17, 2008, at 3:16 PM, Stephan Richter wrote:

 On Friday 17 October 2008, Jim Fulton wrote:
 testrunner-coverage.txt is failing since this check in.  What's up
 with this?

 It passes for me on Python 2.5.

Sigh.  It passes for me too with 2.5.

 Can you be more specific?

It fails with Python 2.4.

I guess we should live with this. :( I don't feel like chasing it and  
I'm sure you don't either.

Never mind.

Jim

--
Jim Fulton
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] zope.interface: verifyObject vs properties

2008-10-17 Thread Thomas Lotze
Tres Seaver [EMAIL PROTECTED] schrieb:

 Dieter Maurer wrote:
   class C(object):
 implements(I)
 m = property(lambda self: lambda ...: ...)
  
  
  i.e. when a method (declared by the interface) is implemented by a property.
 
 Why would I want to do that, rather than using 'def m(self):'?

- to win an obfucated-code contest
- to get an additional closure for the method that is created each time
  the method is accessed


Viele Grüße,
Thomas Lotze

-- 
Thomas Lotze · [EMAIL PROTECTED]
gocept gmbh  co. kg · forsterstraße 29 · 06112 halle (saale) · germany
http://gocept.com · tel +49 345 1229889 0 · fax +49 345 1229889 1
Zope and Plone consulting and development


signature.asc
Description: PGP signature
___
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] Errors / Warnings in Zope log - what to do?

2008-10-17 Thread Hermann Himmelbauer
Hi,
During testing, I found the following warnings/errors in my zope log:

---
2008-10-17T17:56:50 WARNING ZopePublication Competing writes/reads at ???: 
database conflict error (oid 0x06d3, class zc.queue._queue.BucketQueue, 
serial this txn started with 0x0379451cbf5d7bdd 2008-10-17 15:56:44.851212, 
serial currently committed 0x0379451ccd1f50bb 2008-10-17 15:56:48.075545)
--
2008-10-17T17:58:10 ERROR txn.1121233232 Error in tpc_abort() on manager 
zope.sqlalchemy.datamanager.SessionDataManager object at 0x35a4f50
Traceback (most recent call last):
  
File 
/home/dusty/prog/bsp/buildout/eggs/ZODB3-3.8.0-py2.4-linux-x86_64.egg/transaction/_transaction.py,
 
line 462, in _cleanup
rm.tpc_abort(self)
  
File 
/home/dusty/prog/bsp/buildout/eggs/zope.sqlalchemy-0.3-py2.4.egg/zope/sqlalchemy/datamanager.py,
 
line 82, in tpc_abort
raise TypeError(Already committed)
TypeError: Already committed
--
2008-10-17T17:58:10 WARNING ZopePublication Competing writes/reads 
at /BSPSite/act/@@/bspskin-res/bankaustria.gif: database conflict error (oid 
0x06e3, class zope.session.session.SessionData)
--

Why is this happening? I have to admit, that I'm currently 
testing/implementing background tasks with lovely.remotetask - perhaps this 
is the reason? Perhaps it's the combination with zope.sqlalchemy?

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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] Double usage of vocabulary in z3c.form seems to fail

2008-10-17 Thread Hermann Himmelbauer
Am Freitag 17 Oktober 2008 18:06:34 schrieb Hermann Himmelbauer:
 Hi,
 I currently have two schema.Choice() fields in my z3c.form - based form,
 that references the same vocabulary.

Aeh, sorry, forget about it - I had a mistake in my page template, which 
referenced the same widget for two times, hence the failure...

Best Regards,
Hermann

-- 
[EMAIL PROTECTED]
GPG key ID: 299893C7 (on keyservers)
FP: 0124 2584 8809 EF2A DBF9  4902 64B4 D16B 2998 93C7
___
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] traversal: different with and without a request

2008-10-17 Thread Wichert Akkerman
Previously Jim Fulton wrote:
 
 On Oct 17, 2008, at 1:13 PM, Stephan Richter wrote:
 
  On Friday 17 October 2008, Jim Fulton wrote:
  It would be nice to deprecate zope.traversing and fold it into
  zope.app.pagetemplate.
 
  Just skimming the thread, wouldn't this make it harder for us to  
  integrate
  z3c.pt, which also needs those traversal APIs?
 
 
 Yup. Actually, this wants to be in zope.tales. Does z3c.pt use  
 zope.tales?

No.

Wichert.

-- 
Wichert Akkerman [EMAIL PROTECTED]It is simple to make things.
http://www.wiggy.net/   It is hard to make things simple.
___
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 )