Bug 131178

Summary: [GTK] Fails to build documentation when output is redirected
Product: WebKit Reporter: Gustavo Noronha (kov) <gustavo>
Component: New BugsAssignee: Gustavo Noronha (kov) <gustavo>
Status: RESOLVED FIXED    
Severity: Normal CC: pnormand
Priority: P2    
Version: 528+ (Nightly build)   
Hardware: Unspecified   
OS: Unspecified   
Attachments:
Description Flags
Patch mrobinson: review+

Description Gustavo Noronha (kov) 2014-04-03 12:08:56 PDT
[GTK] Fails to build documentation when output is redirected
Comment 1 Gustavo Noronha (kov) 2014-04-03 12:10:06 PDT
Created attachment 228529 [details]
Patch
Comment 2 Gustavo Noronha (kov) 2014-04-03 12:11:40 PDT
I found this while building webkit-clutter which also uses those scripts:

Traceback (most recent call last):
  File "../Tools/gtk/generate-gtkdoc", line 296, in <module>
    saw_webkit1_warnings = generate_doc(generator)
  File "../Tools/gtk/generate-gtkdoc", line 233, in generate_doc
    generator.generate(html='--skip-html' not in sys.argv)
  File "/usr/src/packages/BUILD/webkit-clutter-2.3.5+20140313+c798d3a/Tools/gtk/gtkdoc.py", line 147, in generate
    self._run_gtkdoc_fixxref()
  File "/usr/src/packages/BUILD/webkit-clutter-2.3.5+20140313+c798d3a/Tools/gtk/gtkdoc.py", line 369, in _run_gtkdoc_fixxref
    self._run_command(args, cwd=self.output_dir, ignore_warnings=True)
  File "/usr/src/packages/BUILD/webkit-clutter-2.3.5+20140313+c798d3a/Tools/gtk/gtkdoc.py", line 194, in _run_command
    sys.stdout.write(stdout)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u201c' in position 3856: ordinal not in range(128)
make[3]: *** [docs-build.stamp] Error 1
Comment 3 Philippe Normand 2014-04-09 05:52:47 PDT
Seems like another option would be:

export PYTHONIOENCODING=utf-8
Comment 4 Gustavo Noronha (kov) 2014-04-09 06:46:58 PDT
I think relying on setting something on the environment is not that great =/
Comment 5 Martin Robinson 2014-04-09 07:33:54 PDT
Comment on attachment 228529 [details]
Patch

This approach seems fine to me, but can we move this to generate-gtkdoc?
Comment 6 Gustavo Noronha (kov) 2014-04-15 05:28:35 PDT
I did before I uploaded the patch, following our discussion on IRC =)
Comment 7 Martin Robinson 2014-04-15 05:42:59 PDT
Comment on attachment 228529 [details]
Patch

Sorry! I was going too fast.
Comment 8 Gustavo Noronha (kov) 2014-04-22 11:13:28 PDT
Committed r167669: <http://trac.webkit.org/changeset/167669>