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

Encoding issue? #71

Closed
binghai opened this issue Sep 12, 2011 · 5 comments
Closed

Encoding issue? #71

binghai opened this issue Sep 12, 2011 · 5 comments
Labels

Comments

@binghai
Copy link

binghai commented Sep 12, 2011

When I run rspec spec, after finishing all the tests, simplecov raised this error.

/xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/source_file.rb:140:in block in process_skipped_lines': invalid byte sequence in UTF-8 (ArgumentError) from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/source_file.rb:139:ineach'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/source_file.rb:139:in each_with_index' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/source_file.rb:139:inprocess_skipped_lines'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/source_file.rb:64:in initialize' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/result.rb:24:innew'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/result.rb:24:in block in initialize' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/result.rb:23:ineach'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/result.rb:23:in map' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/result.rb:23:ininitialize'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov.rb:46:in new' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov.rb:46:inresult'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/configuration.rb:120:in block in at_exit' from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/defaults.rb:42:incall'
from /xxx/.rvm/gems/ruby-1.9.2-p290/gems/simplecov-0.5.0/lib/simplecov/defaults.rb:42:in `block in <top (required)>'

There is Chinese characters within my rails app, is that the problem?

My environment is ruby 1.9.2, rails 3.1.0

Thanks a lot!

-binghai

@colszowka
Copy link
Collaborator

Hi, yes. I recently bumped into this as well on the new version while generating coverage for the devise gem. Obviously the newly introduced :nocov: functionality (and the regexp matching it uses) fails for Unicode characters. This is a big problem and I'll resolve it as soon as possible.

@macmartine
Copy link

I'm hitting this as well and don't have any double-byte characters that I'm aware of.

@ghost
Copy link

ghost commented Sep 13, 2011

I think I was able to pinpoint this one. For me it was the tar_input.rb of rubygems. The name Mauricio Julio Fernández .. was creating the error for me. On my system it was located here:
/Users/clint/.rvm/rubies/ruby-1.9.2-p180/lib/ruby/site_ruby/1.9.1/rubygems/package/tar_input.rb

@colszowka
Copy link
Collaborator

Alright, SimpleCov 0.5.3 is out. Please update as soon as possible - and it would be great if those who encountered this issue could report back whether things are resolved for them. Thanks!

@dinatih
Copy link

dinatih commented Dec 6, 2011

Hello,

I've got the same issues with the simplecov 0.5.4

Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/source_file.rb:157:in block in process_skipped_lines!': invalid byte sequence in UTF-8 (ArgumentError) from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/source_file.rb:156:ineach'
from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/source_file.rb:156:in process_skipped_lines!' from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/source_file.rb:98:inlines'
from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/source_file.rb:127:in covered_lines' from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/file_list.rb:7:inblock in covered_lines'
from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/file_list.rb:7:in map' from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/file_list.rb:7:incovered_lines'
from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/file_list.rb:30:in lines_of_code' from /Users/davidherelle/.rvm/gems/ruby-1.9.2-p180@jobteaser.com/ruby/1.9.1/gems/simplecov-0.5.4/lib/simplecov/file_list.rb:35:incovered_percent'
from (erb):17:in `block in format'

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

4 participants