[Zope3-dev] Re: zc.zope3recipes not working on Windows

Hanno Schlichting plone at hannosch.info
Thu May 31 03:47:36 EDT 2007


Hi.

Stephan Richter wrote:
> Hi Jim and other zc.zope3recipes experts,
> 
> I have had some reports from Windows users that the z3c.formdemo -- which is 
> built with zc.zope3recipes -- is not working on Windows. The reported error 
> was as follows:
> 
> E:\formdemo>.\bin\demo fg
> Traceback (most recent call last):
>   File "E:\formdemo\bin\demo-script.py", line 14, in ?
>     zc.zope3recipes.ctl.main([
>   File 
> "e:\formdemo\eggs\zc.zope3recipes-0.5.1-py2.4.egg\zc\zope3recipes\ctl.py", 
> line 47, in main
>     zdaemon.zdctl.main(args, None, Cmd)
>   File 
> "e:\formdemo\eggs\tmp9ghl8n\zdaemon-2.0a6-py2.4.egg\zdaemon\zdctl.py", 
> line 626, in main
>   File 
> "e:\formdemo\eggs\tmp9ghl8n\zdaemon-2.0a6-py2.4.egg\zdaemon\zdctl.py", 
> line 125, in __init__
>   File 
> "e:\formdemo\eggs\tmp9ghl8n\zdaemon-2.0a6-py2.4.egg\zdaemon\zdctl.py", 
> line 185, in get_status
>   File 
> "e:\formdemo\eggs\tmp9ghl8n\zdaemon-2.0a6-py2.4.egg\zdaemon\zdctl.py", 
> line 165, in send_action
> AttributeError: 'module' object has no attribute 'AF_UNIX'
> 
> Is there any chance we can fix that?

I'm not sure if there is a general solution for this problem, as this
would involve making zdaemon aware of and run on Windows, which isn't a
target platform for this particular package for what I witness.

If you want to look for a non-general solution, you can take a look at
the zopectl implementation of Zope2 on the trunk
(svn://svn.zope.org/repos/main/Zope/trunk/lib/python/Zope2/Startup/zopectl.py),
which I made Windows compatible by adding a bit of platform specific code.

I'm sure this can be easily ported to the ctl.py class in zope3recipes
or the zopectl implementation of Zope3.

One of the most basic things you need to do, is to provide a
'get_status' method which doesn't call send_action on Windows...
effectively disabling the checks for a running daemon manager. I
replaced the daemon manager support with support for starting and
stopping a Windows service instead which can also be easily installed
via ./bin/zopectl install

Hanno



More information about the Zope3-dev mailing list