diff options
author | Leonardo Pistone <lpistone@gmail.com> | 2015-04-14 20:11:12 +0200 |
---|---|---|
committer | Leonardo Pistone <lpistone@gmail.com> | 2015-04-14 20:11:12 +0200 |
commit | 0ebd4f0ebab9620a6fc74cb4c0d337ba2c2d8916 (patch) | |
tree | 6e92b3c411ccb5c1b4bbf3574373d8e86b6b510f /coverage/annotate.py | |
parent | e0ad5837194a4a8cd1a2ddf392c5b0db6a80e705 (diff) | |
download | python-coveragepy-git-0ebd4f0ebab9620a6fc74cb4c0d337ba2c2d8916.tar.gz |
Fix #363: crash when annotating non-ascii characters in python 2.
--HG--
extra : amend_source : 8297268531b6014e4f2c2a445385f89688a3fb93
Diffstat (limited to 'coverage/annotate.py')
-rw-r--r-- | coverage/annotate.py | 5 |
1 files changed, 5 insertions, 0 deletions
diff --git a/coverage/annotate.py b/coverage/annotate.py index 3487feb6..d4bbeb3d 100644 --- a/coverage/annotate.py +++ b/coverage/annotate.py @@ -2,6 +2,7 @@ import os, re +from coverage import env from coverage.report import Reporter class AnnotateReporter(Reporter): @@ -89,4 +90,8 @@ class AnnotateReporter(Reporter): dest.write('> ') else: dest.write('! ') + + if env.PY2: + line = line.encode('utf-8') + dest.write(line) |