summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ungurianu <alex.ungurianu@protonmail.com>2022-11-09 23:40:14 +0000
committerGitHub <noreply@github.com>2022-11-09 18:40:14 -0500
commit4b1313530ed147288ee46366a1100eb26c6fde7c (patch)
tree572ea2a9251d571203b96cdbaf7ba637660dbd49
parent51b875ae7186830733f1cd41c2e034cf37a8cbfe (diff)
downloadkazoo-4b1313530ed147288ee46366a1100eb26c6fde7c.tar.gz
recipe(cache): Use protocol.paths.join instead of os.path.join (#682)
os.path.join will do Windows path joining on Windows resulting in bad zookeeper paths
-rw-r--r--kazoo/recipe/cache.py6
1 files changed, 2 insertions, 4 deletions
diff --git a/kazoo/recipe/cache.py b/kazoo/recipe/cache.py
index d527ad2..0a22a6c 100644
--- a/kazoo/recipe/cache.py
+++ b/kazoo/recipe/cache.py
@@ -16,13 +16,11 @@ import contextlib
import functools
import logging
import operator
-import os
from kazoo.exceptions import NoNodeError, KazooException
-from kazoo.protocol.paths import _prefix_root
+from kazoo.protocol.paths import _prefix_root, join as kazoo_join
from kazoo.protocol.states import KazooState, EventType
-
logger = logging.getLogger(__name__)
@@ -336,7 +334,7 @@ class TreeNode(object):
if result.successful():
children = result.get()
for child in sorted(children):
- full_path = os.path.join(path, child)
+ full_path = kazoo_join(path, child)
if child not in self._children:
node = TreeNode(self._tree, full_path, self)
self._children[child] = node