[ZCM] [ZC] 2059/ 2 Comment "bin/zopectl.bat for Windows"

Collector: Zope Bugs, Features, and Patches ... zope-coders-admin at zope.org
Fri Apr 14 16:00:51 EDT 2006


Issue #2059 Update (Comment) "bin/zopectl.bat for Windows"
 Status Pending, Zope/test medium
To followup, visit:
  http://www.zope.org/Collectors/Zope/2059

==============================================================
= Comment - Entry #2 by camil7 on Apr 14, 2006 4:00 pm

zopectl indeed does not work in Windows, as far as I know.

 As "os.uname" is not guaranteed to exist (the python docs speak
vaguely about "recent flavors of Unix"), it might be better
to replace 

  if os.uname()[0] != 'Darwin':

by

  if hasattr(os,'uname') and os.uname()[0] != 'Darwin':

or similar.

 Obviously this change does not make zopectl.py useful with
Windows, however. Maybe it is better to terminate early if
zopectl.py detects it is running under Windowss

Maybe set this to "wontfix" unless someone provides a good way
to run tests for add-on Products under Windows (which seems
to be the thing the OP wanted to do in the first place).

________________________________________
= Request - Entry #1 by Anonymous User on Apr 4, 2006 4:04 am

I create from Unix batch file Zope\skel\bin\zopectl.in new Windows batch file zopectl.bat.in. 

Content is like this:
@set PYTHON=<<PYTHON>>
@set ZOPE_HOME=<<ZOPE_HOME>>
@set INSTANCE_HOME=<<INSTANCE_HOME>>
@set SOFTWARE_HOME=<<SOFTWARE_HOME>>
@set CONFIG_FILE=<<INSTANCE_HOME>>\etc\zope.conf
@set PYTHONPATH=%SOFTWARE_HOME%
@set ZDCTL=%SOFTWARE_HOME%\Zope2\Startup\zopectl.py
"%PYTHON%" "%ZDCTL%" -C "%CONFIG_FILE%" %1 %2 %3 %4 %5 %6 %7

When I run bin/zopectl.bat test --dir Products/XXX on Windows I get error messages
like this:

Zope\lib\python\Zope2\Startup\zopectl.py", line 313, in ?
    if os.uname()[0] != 'Darwin':
AttributeError: 'module' object has no attribute 'uname'

Zope\lib\python\Zope2\Startup\zopectl.py", line 312, in ?
    signal.signal(signal.SIGCHLD, signal.SIG_IGN)
AttributeError: 'module' object has no attribute 'SIGCHLD'

Zope\lib\python\Zope2\Startup\zopectl.py", line 324, in ?
    main()
  Zope\lib\python\Zope2\Startup\zopectl.py", line 281, in main
    c = ZopeCmd(options)
  Zope\lib\python\zdaemon\zdctl.py", line 127, in __init__
    self.get_status()
  Zope\lib\python\zdaemon\zdctl.py", line 168, in get_status
    resp = self.send_action("status")
  Zope\lib\python\zdaemon\zdctl.py", line 148, in send_action
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
AttributeError: 'module' object has no attribute 'AF_UNIX'

I think that zopectl.py, zdctl.py , ... are not runnig on Windows ???
==============================================================



More information about the Zope-Collector-Monitor mailing list