[ZCM] [ZC] 1542/ 5 Comment "Python 2.4/Zope 2.8 unittest failure in asyncore.py"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Mon Oct 18 14:54:04 EDT 2004


Issue #1542 Update (Comment) "Python 2.4/Zope 2.8 unittest failure in asyncore.py"
 Status Pending, Zope/bug low
To followup, visit:
  http://collector.zope.org/Zope/1542

==============================================================
= Comment - Entry #5 by ajung on Oct 18, 2004 2:54 pm

2.7.3 and 2.8 are running fine with your patch.

________________________________________
= Comment - Entry #4 by ajung on Oct 18, 2004 2:44 pm

It fails now on 2.7.3 as well. I can not remember that it failed earlier when I tried it with Python 2.4 but maybe
I did something wrong...trying your patch now
________________________________________
= Comment - Entry #3 by tim_one on Oct 18, 2004 3:14 pm


Uploaded:  "patch.txt"
 - http://collector.zope.org/Zope/1542/patch.txt/view
Looks to me like a pre-existing error in medusa, but I don't understand that code at all so I'll just attach a patch with a 1-line fix:  medusa's class monitor_server derives from asyncore.dispatcher, but never invokes the latter's constructor.  As a result, the ._map attribute set by 2.4's asyncore.dispatcher.__init__() never gets set.  Calling the base class constructor repairs this ... OK, I've *almost* talked myself into believing this is an obvious problem with an obvious solution.  Somebody with more courage should check it in <wink>.
________________________________________
= Comment - Entry #2 by tim_one on Oct 18, 2004 3:01 pm

Andreas, I see this failure using Python 2.4b1 on Windows too, but I see the failure both in 2.7 branch and Zope trunk.

Does this test pass for you in 2.7 branch using 2.4b1?
________________________________________
= Request - Entry #1 by ajung on Oct 18, 2004 11:35 am

RROR: test_monitor_factory_with_emergency_user (ZServer.tests.test_config.MonitorServerConfigurationTestCase)
----------------------------------------------------------------------
Traceback (most recent call last):
  File "/opt/python-2.4.0/lib/python2.4/unittest.py", line 260, in run
    testMethod()
  File "/develop/sandboxes/Zope/Zope/lib/python/ZServer/tests/test_config.py", line 230, in test_monitor_factory_with_emergency_user
    self.create().close()
  File "/develop/sandboxes/Zope/Zope/lib/python/ZServer/tests/test_config.py", line 222, in create
    return factory.create()
  File "/develop/sandboxes/Zope/Zope/lib/python/ZServer/datatypes.py", line 193, in create
    password=password)
  File "/develop/sandboxes/Zope/Zope/lib/python/ZServer/medusa/monitor.py", line 265, in __init__
    monitor_server.__init__ (self, hostname, port)
  File "/develop/sandboxes/Zope/Zope/lib/python/ZServer/medusa/monitor.py", line 168, in __init__
    self.create_socket (socket.AF_INET, socket.SOCK_STREAM)
  File "/opt/python-2.4.0/lib/python2.4/asyncore.py", line 261, in create_socket
    self.add_channel()
  File "/opt/python-2.4.0/lib/python2.4/asyncore.py", line 244, in add_channel
    map = self._map
  File "/opt/python-2.4.0/lib/python2.4/asyncore.py", line 366, in __getattr__
    return getattr(self.socket, attr)
AttributeError: '_socketobject' object has no attribute '_map'

==============================================================



More information about the Zope-Collector-Monitor mailing list