Bug 131178 - [GTK] Fails to build documentation when output is redirected
Summary: [GTK] Fails to build documentation when output is redirected
Status: RESOLVED FIXED
Alias: None
Product: WebKit
Classification: Unclassified
Component: New Bugs (show other bugs)
Version: 528+ (Nightly build)
Hardware: Unspecified Unspecified
: P2 Normal
Assignee: Gustavo Noronha (kov)
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2014-04-03 12:08 PDT by Gustavo Noronha (kov)
Modified: 2014-04-22 11:13 PDT (History)
1 user (show)

See Also:


Attachments
Patch (1.41 KB, patch)
2014-04-03 12:10 PDT, Gustavo Noronha (kov)
mrobinson: review+
Details | Formatted Diff | Diff

Note You need to log in before you can comment on or make changes to this bug.
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>