--- GraphvizParser-0.2/parsers/graphviz.py	2012-03-05 12:54:54.319015539 -0500
+++ graphviz.py	2012-03-05 12:54:52.548965225 -0500
@@ -1,4 +1,4 @@
-# -*- coding: iso-8859-1 -*-
+# -*- coding: utf-8 -*-
 """
     MoinMoin - Graphviz Parser
     Based loosely on GNUPLOT parser by MoinMoin:KwonChanYoung
@@ -13,13 +13,15 @@ __version__ = "0.2"
 # Change this to the directory that the Graphviz binaries (dot, neato, etc.)
 # are installed in.
 
-BINARY_PATH = '/usr/bin'
+BINARY_PATH = '/usr/bin/'
 
 from os.path import join
 import os
 import subprocess
 import sha
 import re
+import sys
+import StringIO
 
 from MoinMoin import config
 from MoinMoin.action import AttachFile
@@ -113,7 +115,7 @@ class Parser:
             logging.warn('format %s is incompatible with cmapx option' % format)
             cmapx = None
 
-        digest = sha.new(self.raw).hexdigest()
+        digest = sha.new(self.raw.encode('utf-8')).hexdigest()
 
         # Make sure that an attachments directory exists and that old graphs are
         # deleted.
@@ -232,23 +234,19 @@ class Parser:
                 stdout=subprocess.PIPE,
                 stderr=subprocess.PIPE)
 
-        p.stdin.write(graph_def)
-        p.stdin.flush()
-        p.stdin.close()
-
-        p.wait()
+        (stdoutdata, stderrdata) = p.communicate(input=graph_def.encode('utf-8'))
 
         # Graph data always goes via standard output so that we can extract the
         # width and height if possible.
 
         if need_output:
-            output, attrs = self.process_output(p.stdout, format)
+            output, attrs = self.process_output(StringIO.StringIO(stdoutdata), format)
         else:
             output, attrs = None, {}
 
         # Test for errors.
 
-        errors = p.stderr.read()
+        errors = stderrdata
 
         if len(errors) > 0:
             raise GraphVizError, errors
@@ -289,7 +287,7 @@ class Parser:
         found = False
         attrs = {}
 
-        for line in output.xreadlines():
+        for line in output.readlines():
             if not found and line.startswith("<svg "):
                 for match in self.attr_regexp.finditer(line):
                     attrs[match.group("attr")] = match.group("value")
