pry/pry — Issue #380: ArgumentError: invalid byte sequence in UTF-8 in whereami
Author: banister
Created: 2011-12-19 12:22:10+00:00
State: open
Labels: bug

```
[126] pry(#)> whereami

Frame number: 3/128
Frame type: ifunc
ArgumentError: invalid byte sequence in UTF-8
from /Users/dev/.rvm/gems/ruby-1.9.3-p0/gems/pry-0.9.8.0pre1/lib/pry/default_commands/context.rb:145:in `block (2 levels) in '
[127] pry(#)> _pry_.binding_stack.last.eval("__FILE__")
=> "\x89U\xECH\x89M\xE0H\x8Bu\xE0\x8B}\xEC\xE8d\xF9\xFF\xFFH\x89E\xF8H\x8B}\xF8\xE8\xC0\n\u0016"
[128] pry(#)> _pry_.binding_stack.last.eval("__LINE__")
=> 0
```

and using `cat --ex`

```
Exception: ArgumentError: invalid byte sequence in UTF-8
--
From: /Users/dev/.rvm/gems/ruby-1.9.3-p0/gems/pry-0.9.8.0pre1/lib/pry/default_commands/context.rb @ line 145 @ level: 0 of backtrace (of 173).

140: i_num = num.to_i
141: else
142: i_num = 5
143: end
144:
=>145: if file != Pry.eval_path && (file =~ /(\(.*\))|<.*>/ || file == "" || file == "-e")
146: raise CommandError, "Cannot find local context. Did you use `binding.pry`?"
147: end
148:
149: set_file_and_dir_locals(file)
150:
```