Re: [Zope-dev] [Checkins] SVN: zope.sendmail/trunk/src/zope/sendmail/mailer.py gmail seems to burp nowadays on smtp quit, deep down in smtplib

2008-10-07 Thread Zvezdan Petkovic
On Oct 5, 2008, at 1:57 AM, Adam Groszer wrote:

 Log message for revision 91759:
  gmail seems to burp nowadays on smtp quit, deep down in smtplib
  mail should be safely sent at this point

... deep down ... should be ...
These words do not sound very encouraging.

 connection.sendmail(fromaddr, toaddrs, message)
 -connection.quit()
 +try:
 +connection.quit()
 +except:
 +pass

The purpose of quit() is unrelated to whether the mail was or was not  
sent.  The purpose is to gracefully send a QUIT to SMTP server and  
then _close_ the socket.

Are we absolutely sure that the socket gets closed here and that we  
are not leaking sockets (i.e., file handles) here?

If we are not, we should not pass on the exception.
Moreover, we should not pass on _every_ exception.

___
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.sendmail/trunk/src/zope/sendmail/mailer.py try again with catching sslerror, thx Jens

2008-10-07 Thread Zvezdan Petkovic
On Oct 5, 2008, at 4:51 AM, Adam Groszer wrote:

 connection.sendmail(fromaddr, toaddrs, message)
 try:
 connection.quit()
 -except:
 +except socket.sslerror:
 +#something weird happened while quiting
 pass

This is better because it catches a _specific_ exception.

However, are we _certain_ that the socket is closed after this?

If not, I think we should close it explicitly instead of passing on it.

Thoughts, comments, anybody?

___
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-07 Thread Zope Tests Summarizer
Summary of messages to the zope-tests list.
Period Mon Oct  6 11:00:00 2008 UTC to Tue Oct  7 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: Mon Oct  6 20:52:56 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010275.html

Subject: OK : Zope-2.9 Python-2.4.4 : Linux
From: Zope Tests
Date: Mon Oct  6 20:54:26 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010276.html

Subject: OK : Zope-2.10 Python-2.4.4 : Linux
From: Zope Tests
Date: Mon Oct  6 20:55:58 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010277.html

Subject: OK : Zope-2.11 Python-2.4.4 : Linux
From: Zope Tests
Date: Mon Oct  6 20:57:28 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010278.html

Subject: OK : Zope-trunk Python-2.4.4 : Linux
From: Zope Tests
Date: Mon Oct  6 20:58:58 EDT 2008
URL: http://mail.zope.org/pipermail/zope-tests/2008-October/010279.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] [Checkins] SVN: zope.sendmail/trunk/src/zope/sendmail/mailer.py try again with catching sslerror, thx Jens

2008-10-07 Thread Fred Drake
On Tue, Oct 7, 2008 at 11:00 AM, Zvezdan Petkovic [EMAIL PROTECTED] wrote:
 However, are we _certain_ that the socket is closed after this?

smtplib does *not* close the client socket if there's an exception
while sending the quit message or processing the response.  It could
be best if connection..close() were called in the case of an
exception.


  -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] Relative Imports: PEP-328

2008-10-07 Thread Sidnei da Silva
I'm trying to fix some import errors, which seem to be related to PEP-328.

I'm fixing those errors this way, though I don't know if that's the
recommended way of fixing it. Thoughts?


try:
from DT_Util import parse_params, name_param
except ImportError:
# See PEP-328
from .DT_Util import parse_params, name_param


-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
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] Python 2.6: 'with' in Interfaces

2008-10-07 Thread Sidnei da Silva
Trying to run some tests with Python 2.6 I stumbled on a problem that
I need help with: an interface that has an attribute named 'with'.

The interface in question is defined in zope.app.component.back35:

class IAdapterRegistration(IComponentRegistration):
...
with = schema.Tuple(
title = _(With interfaces),
...

Any suggestions on how to fix this one?

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
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] Relative Imports: PEP-328

2008-10-07 Thread Marius Gedminas
On Wed, Oct 08, 2008 at 12:14:29AM -0300, Sidnei da Silva wrote:
 I'm trying to fix some import errors, which seem to be related to PEP-328.
 
 I'm fixing those errors this way, though I don't know if that's the
 recommended way of fixing it. Thoughts?
 
 
 try:
 from DT_Util import parse_params, name_param
 except ImportError:
 # See PEP-328
 from .DT_Util import parse_params, name_param
 

I'd suggest converting it to an absolute import

  from zope.documenttemplate.dt_util import parse_params, name_param

or whatever the equivalent for Zope 2 is (I'm assuming it's Zope 2,
since DT_Util is capitalized).

Marius Gedminas
-- 
My mail reader can beat up your mail reader.


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] Python 2.6: 'with' in Interfaces

2008-10-07 Thread Marius Gedminas
On Wed, Oct 08, 2008 at 12:35:39AM -0300, Sidnei da Silva wrote:
 Trying to run some tests with Python 2.6 I stumbled on a problem that
 I need help with: an interface that has an attribute named 'with'.
 
 The interface in question is defined in zope.app.component.back35:
 
 class IAdapterRegistration(IComponentRegistration):
 ...
 with = schema.Tuple(
 title = _(With interfaces),
 ...
 
 Any suggestions on how to fix this one?

The backwards-compatibility interfaces are supposed to expire after 3
releases (or was it years?), maybe we can simply remove this one?

If BBB weren't a consideration, you could rename this attribute to
with_, as that seems to be the current convention for names that are
also keywords (e.g. ZCML directives that have a 'class' attribute name
it 'class_' in the corresponding interface).

Marius Gedminas
-- 
H.323 has much in common with other ITU-T standards - it features a complex
binary wire protocol, a nightmarish implementation, and a bulk that can be used
to fell medium-to-large predatory animals.
-- Anthony Baxter


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] Relative Imports: PEP-328

2008-10-07 Thread Sidnei da Silva
On Wed, Oct 8, 2008 at 2:40 AM, Marius Gedminas [EMAIL PROTECTED] wrote:
 I'd suggest converting it to an absolute import

  from zope.documenttemplate.dt_util import parse_params, name_param

So I thought at first. Except there is a problem:

Inside 'DocumentTemplate' there's another 'DocumentTemplate' module. So doing:

 'from DocumentTemplate.DT_Util import parse_params'

... tries to import DT_Util from the relative module. Then the fix is to do:

 'from __future__ import absolute_import'

... except that doesn't work on Python 2.4.

So the try: except seems to be the only way around here, unfortunately.

 or whatever the equivalent for Zope 2 is (I'm assuming it's Zope 2,
 since DT_Util is capitalized).

Another option might be to switch this to use zope.documenttemplate. :)

-- 
Sidnei da Silva
Enfold Systemshttp://enfoldsystems.com
Fax +1 832 201 8856 Office +1 713 942 2377 Ext 214
___
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 )