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

Invalid byte sequence in US-ASCII (ArgumentError) #268

Closed
hagerhink opened this issue Mar 17, 2015 · 6 comments
Closed

Invalid byte sequence in US-ASCII (ArgumentError) #268

hagerhink opened this issue Mar 17, 2015 · 6 comments
Assignees
Labels

Comments

@hagerhink
Copy link

When using lolcommits, one of my commit messages contained an "Ö", which produced an "invalid byte sequence in US-ASCII (ArgumentError)". All subsequent commits now produce this error and fails to capture an image, regardless of commit message. Have tried to disable and reenable lolcommits aswell as reinstalling it without any luck.

Stack trace:

/Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/lib.rb:846:in `split': invalid byte sequence in US-ASCII (ArgumentError)
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/lib.rb:846:in `command_lines'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/lib.rb:145:in `full_log_commits'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/log.rb:119:in `run_log'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/log.rb:112:in `check_log'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/git-1.2.9.1/lib/git/log.rb:89:in `first'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/lib/lolcommits/git_info.rb:14:in `initialize'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/lib/lolcommits/runner.rb:18:in `new'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/lib/lolcommits/runner.rb:18:in `initialize'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/bin/lolcommits:134:in `new'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/bin/lolcommits:134:in `block in do_capture'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/bin/lolcommits:148:in `fork_me?'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/bin/lolcommits:118:in `do_capture'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/lib/ruby/gems/2.1.0/gems/lolcommits-0.5.7/bin/lolcommits:384:in `<top (required)>'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/bin/lolcommits:23:in `load'
    from /Users/henrikhansson/.rvm/rubies/ruby-2.1.2/bin/lolcommits:23:in `<main>'
    from /Users/henrikhansson/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `eval'
    from /Users/henrikhansson/.rvm/gems/ruby-2.1.2/bin/ruby_executable_hooks:15:in `<main>' 
@matthutchinson
Copy link
Member

Looks like the git gem is having trouble reading your commit message from an earlier commit due to encoding issues. I've been unable to replicate the bug here probably because I can't get the exact char sequence you have in that message. I've tried a commit with that char, and other weird chars including emoji's and they all still work.

To help debug can you provide the output of locale on your machine, and can you create a new empty git repo, use the exact same commit message you believe is causing the issue, and try lolcommits there?

@matthutchinson matthutchinson self-assigned this Mar 24, 2015
@matthutchinson
Copy link
Member

Digging further, it seems there are a few issues with the git gem we are using around encoding (and one un-merged PR that suggests a fix). I'll add a comment on one of the existing issues that we're having the same problem.

@matthutchinson
Copy link
Member

One other thing, can you try the following;

echo $LANG

(and paste the output, then create a new ruby file with this content and run it)

echo "p __ENCODING__ " >> test.rb
ruby test.rb  

(and paste the output)

@hagerhink
Copy link
Author

Unfortunately, I am no longer able to reproduce the error in the old repo or a new one.

Using lolcommits (0.5.7)

locale:

LANG=
LC_COLLATE="C"
LC_CTYPE="UTF-8"
LC_MESSAGES="C"
LC_MONETARY="C"
LC_NUMERIC="C"
LC_TIME="C"
LC_ALL=

echo $LANG:

(no output, just a blank row)

ruby test.rb

#<Encoding:UTF-8>

@matthutchinson
Copy link
Member

Werid, OK can we close this for now? Given the bug is originating from the git gem. We'll be sure to keep up with any fixes they release and push out a new version of lolcommits.

@hagerhink
Copy link
Author

Haha, yeah, it's totally fine by me :)

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

2 participants