Kazoo problems on Windows 7

641 views
Skip to first unread message

thomas.c...@gmail.com

unread,
Apr 23, 2013, 6:30:38 AM4/23/13
to pyth...@googlegroups.com
Hi all,

apologies if this is not the correct place to post this, i have a project i am looking at a kazoo interface for.  I have the following test program which when running on windows throws an error but runs fine on linux (Centos 6.4).

I have the latest version of kazoo according to pip and running 2.7.3.  I do my dev on windws (with PyCharm) so was hoping to be able to test this on windows and not have to cross load to linux every time.  Am i doing something wrong?


Source (may look familiar!)

from kazoo.client import KazooClient

if __name__=='__main__':

    zk = KazooClient(hosts='192.168.0.89')
    zk.start()

    # Ensure a path, create if necessary
    zk.ensure_path("/my/favorite")

    # Create a node with data
    zk.create("/my/favorite/node", b"a value")

    if zk.exists("/my/favorite"):
        # Print the version of a node and its data
        data, stat = zk.get("/my/favorite")
        print("Version: %s, data: %s" % (stat.version, data.decode("utf-8")))

        # List the children
        children = zk.get_children("/my/favorite")
        print("There are %s children with names %s" % (len(children), children))

    zk.stop()

when run throws the following

C:\Python27\python.exe C:/Users/tom/PycharmProjects/Rivendell/Tests/ZookeeperTest/ZookeeperTest.py
No handlers could be found for logger "kazoo.protocol.connection"
Exception in thread Thread-3:
Traceback (most recent call last):
  File "C:\Python27\lib\threading.py", line 810, in __bootstrap_inner
    self.run()
  File "C:\Python27\lib\threading.py", line 763, in run
    self.__target(*self.__args, **self.__kwargs)
  File "C:\Python27\lib\site-packages\kazoo\protocol\connection.py", line 432, in zk_loop
    if self._connect_loop(retry) is False:
  File "C:\Python27\lib\site-packages\kazoo\protocol\connection.py", line 472, in _connect_loop
    [], [], timeout)[0]
  File "C:\Python27\lib\site-packages\kazoo\handlers\threading.py", line 254, in select
    return select.select(*args, **kwargs)
error: (10038, 'An operation was attempted on something that is not a socket')

regards

Tom

Hanno Schlichting

unread,
Apr 24, 2013, 9:31:24 AM4/24/13
to thomas.c...@gmail.com, pyth...@googlegroups.com
Hi.

This is the correct place.

The error you get sounds very Windows specific. A simple Google query
hints at problems with the Windows IP stack or firewalls
(http://support.microsoft.com/kb/318584,
http://support.microsoft.com/kb/817571).

That said, I don't know of anyone having tried Kazoo on Windows yet,
so we might use some Unix specific functionality.

Hanno
> --
> You received this message because you are subscribed to the Google Groups
> "python-zk" group.
> Visit this group at http://groups.google.com/group/python-zk?hl=en.
>
>

thomas.c...@gmail.com

unread,
Apr 24, 2013, 11:26:23 AM4/24/13
to pyth...@googlegroups.com, thomas.c...@gmail.com
Hi Hano,

thanks for the response - yes i suspect its a windows thing - didnt know if the library was unix only or supported windows

regards

Tom

vitaly numenta

unread,
Apr 25, 2013, 12:20:12 PM4/25/13
to pyth...@googlegroups.com, thomas.c...@gmail.com
The problem in this block of code

```
                    s = self.handler.select([self._socket, self._read_pipe],
                            [], [], timeout)[0]
```

is almost certainly because Windows API (used to be "Win32" last time I worked with it) doesn't support calling select on non-socket objects. In this case, I am guessing that self._read_pipe is a non-socket object. The way we used to get around these issues in Windows, IIRC, is by using their "wait on multiple objects" API function instead of select. Windows has a complimentary API function (I don't remember its name) that wraps a socket in an object that can then be passed to  "wait on multiple objects" instead of the socket.

Hope I am not too far off :)

Best,
Vitaly

kc66

unread,
Sep 11, 2014, 4:45:24 PM9/11/14
to pyth...@googlegroups.com, thomas.c...@gmail.com

So, am I right in saying that Kazoo in its present form simply doesn't work on Windows?
If so, I am very puzzled why this fact is not posted in bold face on the official Kazoo webpage?

Thank you!
kc

Ben Bangert

unread,
Sep 23, 2014, 3:32:05 PM9/23/14
to pyth...@googlegroups.com, thomas.c...@gmail.com
On Thursday, September 11, 2014 1:45:24 PM UTC-7, kc66 wrote:

So, am I right in saying that Kazoo in its present form simply doesn't work on Windows?
If so, I am very puzzled why this fact is not posted in bold face on the official Kazoo webpage?


Please try the latest dev code from source, Windows support has just been merged.

柳杨

unread,
Oct 21, 2014, 6:38:37 AM10/21/14
to pyth...@googlegroups.com, thomas.c...@gmail.com
could you give me the url of the latest dev code?
I can just find that the latest code is V2.0 here:https://github.com/python-zk/kazoo   which can not be used in windows

在 2014年9月24日星期三UTC+8上午3时32分05秒,Ben Bangert写道:
Reply all
Reply to author
Forward
0 new messages