]> sipb.mit.edu Git - ikiwiki.git/blobdiff - IkiWiki/Plugin/rst.pm
force charset
[ikiwiki.git] / IkiWiki / Plugin / rst.pm
index 08ac15e43fb419b05e2a5d718c266b44c7bb4a50..789a70ac752b25c2c7aec04d0c79dd61a66f1775 100644 (file)
@@ -44,10 +44,11 @@ sub htmlize (@) { #{{{
        my $content=$params{content};
 
        my $tries=10;
+       my $pid;
        while (1) {
                eval {
                        # Try to call python and run our command
-                       open2(*IN, *OUT, "python", "-c",  $pyCmnd)
+                       $pid=open2(*IN, *OUT, "python", "-c",  $pyCmnd)
                                or return $content;
                };
                last unless $@;
@@ -63,8 +64,13 @@ sub htmlize (@) { #{{{
        
        print OUT $content;
        close OUT;
+
        local $/ = undef;
-       return <IN>;
+       my $ret=<IN>;
+       close IN;
+       waitpid $pid, 0;
+
+       return $ret;
 } # }}}
 
 1