moremoban/moban

UnicodeEncodeError on pypi-mobans@dev on Python 2.7 in hashstore.py get_hash

jayvdb opened this issue · 0 comments

https://travis-ci.org/jayvdb/pypi-mobans/jobs/555687366 is the current dev branch failing on Python 2.7

$ find templates/ -type f -name '*.jj2' -exec echo '{}' \;|sed -e "s/templates\//{%include \"/" -e "s/$/\" %}/" > test.file
The command "find templates/ -type f -name '*.jj2' -exec echo '{}' \;|sed -e "s/templates\//{%include \"/" -e "s/$/\" %}/" > test.file" exited with 0.
$ moban -c config/data.yml -t test.file -td templates .
Traceback (most recent call last):
  File "/home/travis/virtualenv/python2.7.14/bin/moban", line 11, in <module>
    sys.exit(main())
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/main.py", line 45, in main
    count = handle_command_line(options)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/main.py", line 202, in handle_command_line
    options[constants.LABEL_OUTPUT],
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/plugins/template.py", line 89, in render_to_file
    template_abs_path, template, data, output_file
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/plugins/template.py", line 119, in apply_template
    output_file, rendered_content, template_abs_path
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/hashstore.py", line 25, in is_file_changed
    file_name, file_content, source_template
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/hashstore.py", line 39, in _is_source_updated
    content_hash = get_hash(content)
  File "/home/travis/virtualenv/python2.7.14/lib/python2.7/site-packages/moban/hashstore.py", line 68, in get_hash
    md5.update(content)
UnicodeEncodeError: 'ascii' codec can't encode character u'\u2019' in position 18192: ordinal not in range(128)

https://travis-ci.org/jayvdb/pypi-mobans/builds/555687733 - @master , same problems.