Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

coveralls crashes when dealing with malformed encoding declaration #52

Closed
chmduquesne opened this issue Dec 6, 2014 · 2 comments
Closed

Comments

@chmduquesne
Copy link

My project has source code that contains utf-8 (some of my tests are checking if my code works with weird inputs). My tests run fine and the python coverage tool also works fine, but coveralls crashes when processing it: see https://travis-ci.org/chmduquesne/ok/builds/43104434.

I am attaching the traceback:

$ coveralls
Submitting coverage to coveralls.io...
Traceback (most recent call last):
File "/usr/local/bin/coveralls", line 9, in <module>
load_entry_point('coveralls==0.4.4', 'console_scripts', 'coveralls')()
File "/usr/local/lib/python2.7/dist-packages/coveralls/cli.py", line 49, in main
result = coverallz.wear()
File "/usr/local/lib/python2.7/dist-packages/coveralls/api.py", line 73, in wear
data = self.create_data()
File "/usr/local/lib/python2.7/dist-packages/coveralls/api.py", line 122, in create_data
self._data = {'source_files': self.get_coverage()}
File "/usr/local/lib/python2.7/dist-packages/coveralls/api.py", line 132, in get_coverage
return reporter.report()
File "/usr/local/lib/python2.7/dist-packages/coveralls/reporter.py", line 27, in report
self.parse_file(cu, self.coverage._analyze(cu))
File "/usr/local/lib/python2.7/dist-packages/coveralls/reporter.py", line 64, in parse_file
source = source.decode(encoding).encode('utf-8')
UnicodeDecodeError: 'ascii' codec can't decode byte 0xc2 in position 1: ordinal not in range(128)
@coagulant
Copy link
Contributor

I see you've fixed a problem with malformed encoding declaration: chmduquesne/ok@bdbf3f6

Thanks for reporting this problem

@coagulant coagulant changed the title coveralls crashes when dealing with utf-8 source code coveralls crashes when dealing with malformed encoding declaration Jan 5, 2015
@chmduquesne
Copy link
Author

Yes. My keyboard sometimes puts this weird white character instead of a
space, which apparently is not cool when you are declaring the encoding.
Python does not complain, but it makes coverage unhappy, as well as
coveralls. Sorry, I forgot to tell you that I fixed my code.
On Jan 5, 2015 6:04 PM, "Ilya Baryshev" notifications@github.com wrote:

I see you've fixed a problem with malformed encoding declaration:
chmduquesne/ok@bdbf3f6
chmduquesne/ok@bdbf3f6

Thanks for reporting this problem


Reply to this email directly or view it on GitHub
#52 (comment)
.

coagulant added a commit that referenced this issue Jan 5, 2015
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants