Attached patch addresses the following:
1. Formatting redone to be (nearly) consistent
2. Comments added to every function
3. zookeeper.c reorganised logically
4. Py_None now reference counted correctly (see
5. Memory allocations now checked, and general error handling greatly improved.
6. A variety of small bugs and typos fixed
The result is hopefully a much more stable zkpython. This patch will look like a rewrite - there are lots of changes. Apologies to the reviewer in advance!
(I am happy for this patch to be used by the ASF, but the button is not available to be checked).