From 63f672c8b48dfb08d960c0372858e76e45237025 Mon Sep 17 00:00:00 2001
From: Simon Alger <simon.alger@gmail.com>
Date: Thu, 23 Mar 2017 14:47:29 +0200
Subject: [PATCH] Fix cli.py dump not working in py3

dump function was not working in py3 because file object cannot write() a bytes object. Fix: decode bytes object to string before write()ing
---
 pykeyvi/keyvicli/cli.py | 2 ++
 1 file changed, 2 insertions(+)

diff --git a/pykeyvi/keyvicli/cli.py b/pykeyvi/keyvicli/cli.py
index 0eb8a54e..b41ba732 100644
--- a/pykeyvi/keyvicli/cli.py
+++ b/pykeyvi/keyvicli/cli.py
@@ -14,6 +14,8 @@ def dump(args):
         for key, value in dictionary.GetAllItems():
             if args.json_dumps:
                 key = json.dumps(key)
+            if isinstance(key, bytes):
+                key = key.decode()
             file_out.write(key)
             if value:
                 if args.json_dumps: