Skip to content

Commit 4b13135

Browse files
authored
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
1 parent 51b875a commit 4b13135

File tree

1 file changed

+2
-4
lines changed

1 file changed

+2
-4
lines changed

kazoo/recipe/cache.py

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -16,13 +16,11 @@
1616
import functools
1717
import logging
1818
import operator
19-
import os
2019

2120
from kazoo.exceptions import NoNodeError, KazooException
22-
from kazoo.protocol.paths import _prefix_root
21+
from kazoo.protocol.paths import _prefix_root, join as kazoo_join
2322
from kazoo.protocol.states import KazooState, EventType
2423

25-
2624
logger = logging.getLogger(__name__)
2725

2826

@@ -336,7 +334,7 @@ def _process_result(self, method_name, path, result):
336334
if result.successful():
337335
children = result.get()
338336
for child in sorted(children):
339-
full_path = os.path.join(path, child)
337+
full_path = kazoo_join(path, child)
340338
if child not in self._children:
341339
node = TreeNode(self._tree, full_path, self)
342340
self._children[child] = node

0 commit comments

Comments
 (0)