Fwd: Patch for zc.zk
Dave Cahill <[email protected]>
| Newsgroups | gmane.comp.web.zope.devel |
|---|---|
| Message-ID | <CALytfWb1MhN8k1g6yA_mddWfCGkk06Jg4aQOTdN_PzWj9yPJvg@mail.gmail.com> |
Hi, Reposting to the zope-dev list - does anyone know if zc.zk is still active? I have another patch to fix importing nodes with spaces in the name, but maybe I should just fork it instead and apply my fixes there. :) > I was using the export_tree method in zc.zk to dump a zookeeper tree today, and some nodes which > have no data had garbage data dumped instead of an empty string. I think this is an issue in the > underlying zookeeper library, but there is a simple patch to avoid the issue (attached), so if possible > it would be nice to see it added in zc.zk. > > Here's a link to the patch: > https://gist.github.com/davecahill/5539050 Thanks, Dave. _______________________________________________ Zope-Dev maillist - [email protected] https://mail.zope.org/mailman/listinfo/zope-dev ** No cross posts or HTML encoding! ** (Related lists - https://mail.zope.org/mailman/listinfo/zope-announce https://mail.zope.org/mailman/listinfo/zope )
zc_zk_fix_empty_node_export.patch
(application/octet-stream, 521 B)
Index: src/zc/zk/__init__.py
===================================================================
--- src/zc/zk/__init__.py (revision 130228)
+++ src/zc/zk/__init__.py (working copy)
@@ -518,6 +518,10 @@
return
if name is None:
name = path.rsplit('/', 1)[1]
+
+ if(meta["dataLength"] == 0):
+ data = ""
+
properties = decode(data)
type_ = properties.pop('type', None)
if type_: