I got this when running gtkdoc-fixxref during the generation of the WebKit2 documentation. The problem seems to be that the output contains a non-ascii character (the quotes in “activate”) and sys.stdout.write fails.
Created attachment 224413 [details] Patch
Committed r164794: <http://trac.webkit.org/changeset/164794>