Running Plone 5.2 with python 3 on Windows

I am in a perhaps unusual position where my company's dev/production servers are linux based while my personal machine is Win10. This oddly means our dev/prod story is looking good and we will be able to transition before python 2 EOL. But writing and testing code on my machine is a non starter.

I'm not looking for anything fancy here - a non-ZEO, single client is adequate. I don't need it daemonized. The Windows Installer is not an option because the helper script https://github.com/plone/Installers-UnifiedInstaller/blob/windows_install/helper_scripts/windows_install.py is still written in python 2 and looks for a py2 binary. This can be mostly worked around - I am manually building my own python 3.6 venv and just using buildout directly to create a working environment. I had to get a precompiled/transpiled plone.staticresources to at least get it to build. This is sufficient to run unit tests but I can't run a plone.recipe.zope2instance client even in foreground:

C:\Plone52\venv\Scripts\python.exe C:/Plone52/bin/plone-script.py fg
Traceback (most recent call last):
  File "C:/Plone52/bin/plone-script.py", line 315, in <module>
    + sys.argv[1:]))
  File "c:\plone52\eggs\plone.recipe.zope2instance-6.3.0-py3.6.egg\plone\recipe\zope2instance\ctl.py", line 988, in main
    c = ZopeCmd(options)
  File "c:\plone52\eggs\zdaemon-4.3-py3.6.egg\zdaemon\zdctl.py", line 124, in __init__
    self.get_status()
  File "c:\plone52\eggs\plone.recipe.zope2instance-6.3.0-py3.6.egg\plone\recipe\zope2instance\ctl.py", line 469, in get_status
    ZDCmd.get_status(self)
  File "c:\plone52\eggs\zdaemon-4.3-py3.6.egg\zdaemon\zdctl.py", line 242, in get_status
    resp = self.send_action("status")
  File "c:\plone52\eggs\zdaemon-4.3-py3.6.egg\zdaemon\zdctl.py", line 218, in send_action
    sock = socket.socket(socket.AF_UNIX, socket.SOCK_STREAM)
AttributeError: module 'socket' has no attribute 'AF_UNIX'

I noticed that plone.recipe.zope2instance diverges between versions 5.2 and 5.1 (6.3.0 and 4.4.1) in that it is now using some APIs for zdaemon where before it was using Zope2/Startup/zopectl. The zdaemon package says

zdaemon is a Unix (Unix, Linux, Mac OS X) Python program that wraps commands to make them behave as proper daemons.

so it seems odd to me that plone.recipe.zope2instance would insist on zdaemon unless Windows support is to be dropped completely. Windows 10 actually does have support for Unix sockets, but python does not support it yet Issue 33408: Enable AF_UNIX support in Windows - Python tracker. I don't know if this is because of the requirements for waitress/wsgi but if that is a blocker would it be possible to have that optional? Again, for my purpose I am just looking for a standalone, no-zeo, simple python process.

1 Like

What about this new document explaining how to develop on Windows Linux Subsystem? https://github.com/plone/documentation/blob/5.2/manage/installing/installation_windows10_wsl.rst

I was on WSL for about half a year.

I enjoyed having a proper terminal, had access to all Linux tools, but the (io) performance was just terrible.

The test-suite took minimum 3 times in WSL on a new machine compared to a 10 year old Debian PC.

You could go for a very long walk until buildout would finish.

After half a year of "pain" I finally bought a Linux laptop and I am happily ever after.

I did not take a MacBook into account as

  • I never had one
  • no one in the company has one, so I would have to take care of all problems without anybody there to ask
  • the horror stories about the keyboard

Before I went WSL and finally a native Linux laptop, I developed on a Windows PC, but Zope was running on a separate Debian PC - I used both Samba and SSH to connect to it, and it was quite a pleasant experience - except my projects were all scattered between my Windows PC, my virtual machine, and the Debian PC.