summaryrefslogtreecommitdiff
path: root/graph.py
diff options
context:
space:
mode:
authorSylvain Th?nault <sylvain.thenault@logilab.fr>2013-07-26 10:28:07 +0200
committerSylvain Th?nault <sylvain.thenault@logilab.fr>2013-07-26 10:28:07 +0200
commitcfe1107d4f5d8d44e2cf4f9733be145254e6c8e8 (patch)
treeaa80cc1624345afa637caa9d72d306e9e160c20e /graph.py
parent8c9024ac95f410199372806816437488ff3f9194 (diff)
parent07f9b4ac057f646c5232781d01fc34765c1c04c2 (diff)
downloadlogilab-common-cfe1107d4f5d8d44e2cf4f9733be145254e6c8e8.tar.gz
backport stable branch
Diffstat (limited to 'graph.py')
-rw-r--r--graph.py6
1 files changed, 3 insertions, 3 deletions
diff --git a/graph.py b/graph.py
index 5cae530..94a71b6 100644
--- a/graph.py
+++ b/graph.py
@@ -28,7 +28,7 @@ import os.path as osp
import os
import sys
import tempfile
-from logilab.common.compat import str_encode
+import codecs
def escape(value):
"""Make <value> usable in a dot file."""
@@ -106,8 +106,8 @@ class DotBackend:
ppng, outputfile = tempfile.mkstemp(".png", name)
os.close(pdot)
os.close(ppng)
- pdot = open(dot_sourcepath, 'w')
- pdot.write(str_encode(self.source, 'utf8'))
+ pdot = codecs.open(dot_sourcepath, 'w', encoding='utf8')
+ pdot.write(self.source)
pdot.close()
if target != 'dot':
if sys.platform == 'win32':