diff --git a/tonnikala/languages/python/generator.py b/tonnikala/languages/python/generator.py
index <HASH>..<HASH> 100644
--- a/tonnikala/languages/python/generator.py
+++ b/tonnikala/languages/python/generator.py
@@ -435,6 +435,9 @@ class PyComplexExprNode(PyComplexNode):
 class PyBlockNode(PyComplexNode):
     def __init__(self, name):
         super(PyBlockNode, self).__init__()
+        if not isinstance(name, str):
+            name = name.encode('UTF-8') # python 2
+
         self.name = name
fixed the name: needs to be utf8 for python 2