This issue tracker has been migrated to GitHub, and is currently read-only.
For more information, see the GitHub FAQs in the Python's Developer Guide.

Author giampaolo.rodola
Recipients djc, giampaolo.rodola, josiah.carlson, josiahcarlson, r.david.murray
Date 2010-04-21.15:31:03
SpamBayes Score 3.8648548e-07
Marked as misclassified No
Message-id <1271863865.13.0.723107194419.issue8483@psf.upfronthosting.co.za>
In-reply-to
Content
I think the problem relies in here:

    # cheap inheritance, used to pass all other attribute
    # references to the underlying socket object.
    def __getattr__(self, attr):
        return getattr(self.socket, attr)

I wonder why this has been added in the first place.
It also causes confusing error messages when accessing undefined attributes:

>>> class B(asyncore.dispatcher):
...     def __init__(self, *args):
...             asyncore.dispatcher.__init__(self, *args)
...
>>> b = B()
>>> b.blabla
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
  File "/usr/lib/python2.6/asyncore.py", line 394, in __getattr__
    return getattr(self.socket, attr)
AttributeError: '_socketobject' object has no attribute 'blabla'
>>>
History
Date User Action Args
2010-04-21 15:31:05giampaolo.rodolasetrecipients: + giampaolo.rodola, josiahcarlson, josiah.carlson, djc, r.david.murray
2010-04-21 15:31:05giampaolo.rodolasetmessageid: <1271863865.13.0.723107194419.issue8483@psf.upfronthosting.co.za>
2010-04-21 15:31:03giampaolo.rodolalinkissue8483 messages
2010-04-21 15:31:03giampaolo.rodolacreate