[Zope-dev] Zope Tests: 5 OK

2008-03-19 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Tue Mar 18 12:00:00 2008 UTC to Wed Mar 19 12: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: Tue Mar 18 21:52:59 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-March/009270.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Mar 18 21:54:29 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-March/009271.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Mar 18 21:56:00 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-March/009272.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Mar 18 21:57:30 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-March/009273.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Tue Mar 18 21:59:00 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-March/009274.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 )


[Zope-dev] Building / installing Zope on AIX 5.3

2008-03-19 Thread Marcello Bax
Hello,

I compiled Python 2.4.4 on AIX 5.3, with cc_r compiler, installed Zope-2.9.8and
Plone-2.5.1.

Everything seems work well, excepted when I call Plone on the browser or
click on the view tab inside one Plone site at the ZMI.
When I do this, I get a Segmentation fault on the server.

Can anyone help me with this issue?
Are there many AIX and Zope box running Plone?

I found this text in  at Zope-2.9/doc/PLATFORMS/AIX.txt :

from Wolfgang Roesner (reporting segfaults and a fix)

  The default stack size for a pthread on AIX (at least in my
  configuration) is 96kB. On Solaris it's 1M. As soon as I explicitly
  set the initial stack size to 1M the problem went away and it
  appears as if Zope is up and running.

  Unfortunately I really had to change thread_pthread.h in Python
  which obviously is not a nice thing to do as I now have a need for
  my own private version of Python. But at least I have a running
  version of Zope on AIX.

Is this really something to try?

Thank you,
Marcello Bax
___
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: Building / installing Zope on AIX 5.3

2008-03-19 Thread Tres Seaver
-BEGIN PGP SIGNED MESSAGE-
Hash: SHA1

Marcello Bax wrote:
 Hello,
 
 I compiled Python 2.4.4 on AIX 5.3, with cc_r compiler, installed 
 Zope-2.9.8and
 Plone-2.5.1.
 
 Everything seems work well, excepted when I call Plone on the browser or
 click on the view tab inside one Plone site at the ZMI.
 When I do this, I get a Segmentation fault on the server.
 
 Can anyone help me with this issue?
 Are there many AIX and Zope box running Plone?
 
 I found this text in  at Zope-2.9/doc/PLATFORMS/AIX.txt :
 
 from Wolfgang Roesner (reporting segfaults and a fix)
 
   The default stack size for a pthread on AIX (at least in my
   configuration) is 96kB. On Solaris it's 1M. As soon as I explicitly
   set the initial stack size to 1M the problem went away and it
   appears as if Zope is up and running.
 
   Unfortunately I really had to change thread_pthread.h in Python
   which obviously is not a nice thing to do as I now have a need for
   my own private version of Python. But at least I have a running
   version of Zope on AIX.
 
 Is this really something to try?

Yes.  If the 'configure' script for Python has an option to bump the
stack size, that would be better, but patching the Python sources to
increase the stack size is a reasonable workaround, which used to be
required (IIRC) on FreeBSD, too.


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

iD8DBQFH4UVu+gerLs4ltQ4RAuG2AKDNU5BhsDT4kov3aYHO4eTxoXFP5QCeOTfj
1zoDfC1WkgC+AddP/li3riI=
=TPcL
-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] Building / installing Zope on AIX 5.3

2008-03-19 Thread Dieter Maurer
Marcello Bax wrote at 2008-3-19 09:31 -0300:
 ...
I compiled Python 2.4.4 on AIX 5.3, with cc_r compiler, installed Zope-2.9.8and
Plone-2.5.1.

Everything seems work well, excepted when I call Plone on the browser or
click on the view tab inside one Plone site at the ZMI.
When I do this, I get a Segmentation fault on the server.

Looks very much like a C runtime stack overflow.

 ...
I found this text in  at Zope-2.9/doc/PLATFORMS/AIX.txt :

from Wolfgang Roesner (reporting segfaults and a fix)

  The default stack size for a pthread on AIX (at least in my
  configuration) is 96kB. On Solaris it's 1M. As soon as I explicitly
  set the initial stack size to 1M the problem went away and it
  appears as if Zope is up and running.

  Unfortunately I really had to change thread_pthread.h in Python
  which obviously is not a nice thing to do as I now have a need for
  my own private version of Python. But at least I have a running
  version of Zope on AIX.

Is this really something to try?

Definitely. Almost surely, you see precisely this problem (C runtime
stack too small).



-- 
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] Re: zope.sendmail Retry fixes and new state machine.

2008-03-19 Thread Marius Gedminas
On Mon, Mar 10, 2008 at 06:09:50PM +0100, Wichert Akkerman wrote:
[...the usual doctest vs unittest discussion ...]
 Lack of isolation is a very convincing argument to me.

For me as well.  Which is why I put my doctests into a traditional
tests/test_foo.py module like this:

# ... imports etc ...

def doctest_FooClass_somemethod():
Test FooClass.somemethod

 foo = FooClass(ContextStub())

When you frob the groddle, by default you get zlotniks

 foo.frob(GroddleStub())
'42 zlotniks'



def doctest_FooClass_somemethod_special_case():
Test FooClass.somemethod

 foo = FooClass(ContextStub())

There's a very special corner case that happens when the system runs
out of zlotniks

 foo.frob(GroddleStub(zlotniks_required=1000))
Traceback (most recent call last):
  ...
OutOfZlotniksError: 1000 zlotniks required, but only 50 are 
available



def test_suite():
return doctest.DocTestSuite(setUp=setup.placelessSetUp,
tearDown=setup.placelessTearDown,
optionflags=doctest.NORMALIZE_WHITESPACE)


I find that this style helps me write much more readable tests without
sacrificing isolation.

Instead I sacrifice pdb debuggability, that I don't value much (I find
the pdb user interface horrible and prefer debugging with print
statements).

I also sacrifice test reusability -- you can't invoke one doctest from
the middle of another one.  (Footnotes don't count -- invoking a doctest
footnote more than once is just *evil*, because you never know which
invocation failed.).

I find that for me personally, the advantages of test readability
outweigh the disadvantages:

  * doctests without English test explaining each block of related
assertions look naked.  Unittests without comments look normal.  As
a result I feel the urge to explain my doctests when I never felt
the urge to explain my unit tests.  Don't know why that is, but
that's how I feel.

  * The ability to nicely format data for presentation is extremely
helpful.  Compare

 print_table([view.column_titles] + view.getTabularData())
+--+--+--+
| Month| Widgets produced | Widgets sold |
+--+--+--+
| January  | 42   | 17   |
| February | 33   | 25   |
+--+--+--+

with

self.assertEquals(view.getTabularData(),
  [['January', 42, 17],
   ['February', 33, 25]])

Now compare the error messages when the test fails:

Failed example:
print_table([view.column_titles] + view.getTabularData())
Differences (ndiff with -expected +actual):
  +--+--+--+
  | Month| Widgets produced | Widgets sold |
  +--+--+--+
- | January  | 42   | 17   |
^
+ | January  | 43   | 17   |
^
  | February | 33   | 25   |
  +--+--+--+

versus

AssertionError: [['January', 42, 17], ['February', 33, 25]] != 
[['January', 43, 17], ['February', 33, 25]]

I'm not saying that it's impossible to write a better table
comparison function and use that instead of assertEquals.  I'm
saying that with doctests it's easier and feels more natural.

 Perhaps more personal taste but I also find python unittests to be much
 more readable. You don't suffer from mixing lots of test setup/teardown
 being repeated through the file. As Tres mentioned this is especially
 true when testing corner cases.

My solution for repeating setup/teardown:

  * Put things common to all tests in the module (like placelessSetUp,
setup.setUpAnnotations, registering your custom adapters needed for
these tests) into global setUp/tearDown functions, and pass those to
the DocTestSuite constructor.

  * Extract object creation into global reusable helper functions.  Then tests
look like

 context = createFrombulator()
 view = FrombulatorEditView(context, TestRequest())

and you don't have to care in every test that your Frombulator needs
seventeen Wodgets in a nested tree of Grompets for correct
functioning.  These helper functions are parametrizable, so that if
I find out that I need a very custom wodget in a particular test, I
can do

 my_wodget = Wodget('foo', 'bar')
 

Re: [Zope-dev] Re: zope.sendmail Retry fixes and new state machine.

2008-03-19 Thread Marius Gedminas
On Tue, Mar 11, 2008 at 09:25:59AM -0400, Jim Fulton wrote:
 I'm not sure what scaffolding you're referring to. Do you mean test set up? 
 Or the tools for normalizing output?  For test set up, I don't think 
 there's any difference.  I can sympathize with the skepticism with 
 normalizing output.  Sometimes, I think it might be better to write 
 documented tests rather than executable documentation and use assertion of 
 a more traditional nature, if the test is still readable, although I 
 suspect that it will often be easier to normalize output rather than make 
 lots of assertions about the output.

My personal experience with doctest output normalizers (as used in
zope.testing's unit tests) was very painful.  To quote jwz:

  Some people, when confronted with a problem, think I know, I’ll use
  regular expressions. Now they have two problems

Normalizing output might be the easier way when you initially write the
test.  But when some time later your test starts failing, they're a
nightmare to debug.

Marius Gedminas
-- 
Any sufficiently advanced technology is indistinguishable from a rigged demo.
- Andy Finkel, computer guy


signature.asc
Description: Digital 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.sendmail Retry fixes and new state machine.

2008-03-19 Thread Marius Gedminas
On Sun, Mar 09, 2008 at 08:54:11PM -0400, Gary Poster wrote:
 I did a five-minute skim of the checkin but hope to look a bit more 
 tomorrow.  Hopefully Marius, Benji, Albertas, or someone else who has 
 actually done work on this package will take a look and chime in.

I intend to.  Actually, I feel the obligation to.  Sadly, the feeling of
obligation usually leads me to procrastinate and do something completely
different... 

Marius Gedminas
-- 
The BeOS takes the best features from the major operating systems. It's got
the power and flexibility of Unix, the interface and ease of use of the MacOS,
and Minesweeper from Windows.
-- Tyler Riti


signature.asc
Description: Digital 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] zope.sendmail grantma-retryfixes branch review

2008-03-19 Thread Marius Gedminas
I'm starting a new thread, because the original one got hijacked by the
doctest/unittest flamefest.

I appear to have unsubscribed from zope3-checkins a while ago, which is
why I'm posting here.

Disclaimer: I'm not very good at doing code reviews.  I tend to mention
every little detail that could've been improved and forget to praise
everything that's already perfect.

There are two checkins on the branch.

=
rev 84645
=
http://svn.zope.org/zope.sendmail/branches/grantma-retryfixes/?rev=84645view=rev

Matthew, Subversion thinks the two PDF files you added are plain-text
(svn:eol-style is native, and svn diff shows the actual contents of
the PDFs, which isn't very useful to human readers).  I would suggest

  svn propdel svn:eol-style *.pdf
  svn propset svn:mime-type application/pdf *.pdf

Also, the Quue_*.pdf seems to have a typo in the file name.

At first sight those diagrams look scary and complicated.  I'd look into
ways to express their content in a text file with plain-text
explanations and ASCII-art diagrams.

=
rev 84551
=
http://svn.zope.org/zope.sendmail/branches/grantma-retryfixes/?rev=84551view=rev

 Index: src/zope/sendmail/configure.zcml
 ===
 --- src/zope/sendmail/configure.zcml  (revision 84550)
 +++ src/zope/sendmail/configure.zcml  (revision 84551)
 @@ -14,11 +14,18 @@
  
!--
  To send mail, uncomment the following directive and be sure to
 -create the queue directory.
 +create the queue directory. 
 +
 +Other parameters sepcify the polling interval, and the retry 

sepcify?

 +interval used when a temporary failure is detected.  Lock links
 +can also be cleared on server start.
  
mail:queuedDelivery permission=zope.SendMail
queuePath=./queue
 -  mailer=smtp /
 +  retryInterval=300
 +  pollingInterval=3000
 +   cleanLockLinks=False
 +   mailer=smtp /
--

Please avoid literal tab characters in source files.

 Index: src/zope/sendmail/zcml.py
 ===
 --- src/zope/sendmail/zcml.py (revision 84550)
 +++ src/zope/sendmail/zcml.py (revision 84551)
 @@ -70,7 +70,35 @@ class IQueuedDeliveryDirective(IDelivery
  description=uDefines the path for the queue directory.,
  required=True)
  
 -def queuedDelivery(_context, permission, queuePath, mailer, name=Mail):
 +pollingInterval = Int(
 +title=u'Polling Interval',
 +description=u'Defines the polling interval for queue processing in'
 +' milliseconds',
 +default=3000,
 +required=False)
...
 -thread = QueueProcessorThread()
 +thread = QueueProcessorThread(interval=pollingInterval/1000,

You're using integer division here and losing sub-second precision.  If you
don't want that, write interval=pollingInterval/1000.0.

 +  retry_interval=retryInterval,
 +  clean_lock_links=cleanLockLinks)
  thread.setMailer(mailerObject)
  thread.setQueuePath(queuePath)
  thread.start()
 
 Index: src/zope/sendmail/mailer.py
 ===
 --- src/zope/sendmail/mailer.py   (revision 84550)
 +++ src/zope/sendmail/mailer.py   (revision 84551)
...
 @@ -41,22 +49,105 @@ class SMTPMailer(object):
  self.password = password
  self.force_tls = force_tls
  self.no_tls = no_tls
 +self.logger = None
  
 -def send(self, fromaddr, toaddrs, message):
 -connection = self.smtp(self.hostname, str(self.port))
 +def set_logger(self, logger):
 +if not isinstance(logger, logging.Logger):
 +raise DoesNotImplement('Invalid logger given')

I don't think DoesNotImplement is right here -- there are no interfaces
you're looking for.  Better use the built-in TypeError.

But is the type check necessary at all?  The Pythonic thing is to rely on duck
typing.

 +self.logger = logger
 +
 +def _log(self, log_level, *args):
 +if self.logger is None:
 +return
 +# This is not elegant, but it can be fixed later

In my experience later usually doesn't happen.  Why not fix it now?

 +if log_level == 'debug':
 +self.logger.debug(*args)
 +elif log_level =='info':
 +self.logger.info(*args)
 +elif log_level =='error':
 +self.logger.error(*args)
 +elif log_level =='warning':
 +self.logger.warning(*args)
 +

Just use

   self.logger.log(log_level, *args)

and logging.DEBUG/logging.INFO/logging.ERROR/logging.WARNING as the
values for log_level.

 +def _handle_smtp_error(self,
 +   smtp_code,
 +   smtp_error,
 + 

Re: [Zope-dev] Building / installing Zope on AIX 5.3

2008-03-19 Thread Marcello Bax
Thank you for the help.
The unifiedInstaller from plone.org seems to have a Python package that
corrects this stack size issue.

After installing GNU versions of tar, make, gcc and ln on AIX-5.3, I
followed, step by step, the install.sh script from unifiedInstaller bundle
using bash shell. I continued progressing and correcting some small AIX
environment differences.
It worked very well. Many thanks to the Plone community and the
unifiedinstaller!

Marcello Bax
Paradigma.com.br

On Wed, Mar 19, 2008 at 3:54 PM, Dieter Maurer [EMAIL PROTECTED] wrote:

 Marcello Bax wrote at 2008-3-19 09:31 -0300:
  ...
 I compiled Python 2.4.4 on AIX 5.3, with cc_r compiler, installed
 Zope-2.9.8and
 Plone-2.5.1.
 
 Everything seems work well, excepted when I call Plone on the browser or
 click on the view tab inside one Plone site at the ZMI.
 When I do this, I get a Segmentation fault on the server.

 Looks very much like a C runtime stack overflow.

  ...
 I found this text in  at Zope-2.9/doc/PLATFORMS/AIX.txt :
 
 from Wolfgang Roesner (reporting segfaults and a fix)
 
   The default stack size for a pthread on AIX (at least in my
   configuration) is 96kB. On Solaris it's 1M. As soon as I explicitly
   set the initial stack size to 1M the problem went away and it
   appears as if Zope is up and running.
 
   Unfortunately I really had to change thread_pthread.h in Python
   which obviously is not a nice thing to do as I now have a need for
   my own private version of Python. But at least I have a running
   version of Zope on AIX.
 
 Is this really something to try?

 Definitely. Almost surely, you see precisely this problem (C runtime
 stack too small).



 --
 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 )