Author xdegaye
Recipients amaury.forgeotdarc, giampaolo.rodola, josiahcarlson, stutzbach, xdegaye
Date 2011-10-05.21:00:24
SpamBayes Score 1.08895e-07
Marked as misclassified No
Message-id <>
> So, in 3.1 hasattr(y, '__setstate__') *did* recurse and hit the limit,
> but the exception was caught and hasattr returned False?

This is right.

> I think I prefer the new behavior...
> The patch looks good, I would simply have raised AttributeError(name)
> though.

It is fine with me to raise AttributeError(name).
Note that when raising AttributeError('socket'), the user gets
notified of the exceptions on both 'socket' and 'name'.
For example with the patch applied:

$ python3
Python 3.2 (r32:88445, Jun 18 2011, 20:30:18) 
[GCC 4.3.2] on linux2
Type "help", "copyright", "credits" or "license" for more information.
>>> import asyncore
>>> a = asyncore.dispatcher()
>>> del a.socket
Traceback (most recent call last):
  File "", line 415, in __getattr__
    retattr = getattr(self.socket, attr)
  File "", line 413, in __getattr__
    % self.__class__.__name__)
AttributeError: dispatcher instance has no attribute 'socket'

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "", line 418, in __getattr__
    %(self.__class__.__name__, attr))
AttributeError: dispatcher instance has no attribute 'foo'
Date User Action Args
2011-10-05 21:00:25xdegayesetrecipients: + xdegaye, josiahcarlson, amaury.forgeotdarc, giampaolo.rodola, stutzbach
2011-10-05 21:00:25xdegayesetmessageid: <>
2011-10-05 21:00:24xdegayelinkissue13103 messages
2011-10-05 21:00:24xdegayecreate