Skip to content

Commit

Permalink
recipe(cache): Use protocol.paths.join instead of os.path.join (#682)
Browse files Browse the repository at this point in the history
os.path.join will do Windows path joining on Windows resulting in bad zookeeper paths
  • Loading branch information
a-ungurianu authored Nov 9, 2022
1 parent 51b875a commit 4b13135
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions kazoo/recipe/cache.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,13 +16,11 @@
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__)


Expand Down Expand Up @@ -336,7 +334,7 @@ def _process_result(self, method_name, path, result):
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
Expand Down

0 comments on commit 4b13135

Please sign in to comment.