lyungn / support-tools

Automatically exported from code.google.com/p/support-tools
Apache License 2.0
0 stars 0 forks source link

More Unicode fixes #43

Closed GoogleCodeExporter closed 9 years ago

GoogleCodeExporter commented 9 years ago
What steps will reproduce the problem?

# mkdir /tmp/unicodetest
# cd /tmp/unicodetest
# git clone https://code.google.com/p/support-tools/
# hg clone https://wiki.ipv6-hosts.googlecode.com/hg wiki --insecure
# python ./support-tools/wiki_to_md/wiki2gfm.py 
--input_file=./wiki/DoIHaveToUseIt.wiki --output_file=o.md
Traceback (most recent call last):
  File "./support-tools/wiki_to_md/wiki2gfm.py", line 121, in <module>
    main(sys.argv)
  File "./support-tools/wiki_to_md/wiki2gfm.py", line 117, in main
    converter.Convert(input_stream, output_stream)
  File "/tmp/unicodetest/support-tools/wiki_to_md/impl/converter.py", line 117, in Convert
    input_line = self._ExtractPragmas(input_line, input_lines, output_stream)
  File "/tmp/unicodetest/support-tools/wiki_to_md/impl/converter.py", line 156, in _ExtractPragmas
    pragma_value.strip())
  File "/tmp/unicodetest/support-tools/wiki_to_md/impl/pragma_handler.py", line 50, in HandlePragma
    .format(pragma_value))
UnicodeEncodeError: 'ascii' codec can't encode characters in position 0-4: 
ordinal not in range(128)

What is the expected output? What do you see instead?

# python ./support-tools/wiki_to_md/wiki2gfm.py 
--input_file=./wiki/DoIHaveToUseIt.wiki --output_file=o.md
Warning (line 1 of input file):
A summary pragma was used for this wiki:
        **************
Consider moving it to an introductory paragraph.

Warning (line 2 of input file):
The following pragma has been ignored:
        #labels *************
Consider expressing the same information in a different manner.

What version of the product are you using? On what operating system?

Revision 937ced33b1eb4e7dba8265eeb76f1da7fc0448d1

GNU bash, version 4.1.2(1)-release-by_tst_tlinux_v1004 
(x86_64-unknown-linux-gnu)

Distributor ID: Ubuntu
Description:    Ubuntu 14.04.2 LTS
Release:        14.04
Codename:       trusty

Please provide any additional information below.

Both attachments (exported by different git commands) represent the same commit.

Original issue reported on code.google.com by xslidian on 16 Mar 2015 at 2:19

Attachments:

GoogleCodeExporter commented 9 years ago
Thank you for the patches. Python expert Nick Gorski will handle integrating it.

Original comment by chrsm...@google.com on 16 Mar 2015 at 4:09

GoogleCodeExporter commented 9 years ago
Thanks for your help! Once you've accepted the contributors license agreement 
at http://code.google.com/legal/individual-cla-v1.0.html I can take your 
patches directly.

I intended to fix this class of problems in my last patch, thanks for catching 
these instances. I've done another full pass over the code and the last of 
these formatting strings should be good. Let me know if you need anything else.

Original comment by ngorski@google.com on 16 Mar 2015 at 6:09

GoogleCodeExporter commented 9 years ago
Thanks for fixing it. :D

I've accepted the agreement. Sorry I didn't sign it up earlier.

Please apply the patch in Issue 41 if possible. Lazy people like me could 
benefit from it. :)

Original comment by xslidian on 17 Mar 2015 at 7:22