Issue #14324 has been updated by naruse (Yui NARUSE).

Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE

ruby_2_5 r62905 merged revision(s) 62548,62894.

----------------------------------------
Bug #14324: Should Exception#full_message include escape sequences?
https://bugs.ruby-lang.org/issues/14324#change-71186

* Author: Eregon (Benoit Daloze)
* Status: Closed
* Priority: Normal
* Assignee: sorah (Sorah Fukumori)
* Target version: 2.6
* ruby -v: ruby 2.5.0p0 (2017-12-25 revision 61468) [x86_64-linux]
* Backport: 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE
----------------------------------------
```
$ ruby -e 'p RuntimeError.new("foo").full_message'
"\e[1mTraceback \e[m(most recent call last):\n-e:1:in `full_message': \e[1mfoo (\e[4;1mRuntimeError\e[m\e[1m)\n\e[m"
```

That is probably not intended.

```
$ ruby -e 'p RuntimeError.new("foo").full_message' |& cat
"-e:1:in `full_message': foo (RuntimeError)\n"
```

So `Exception#full_message` depends if stderr is a tty which seems wrong.
I think it should be the second result, i.e., no escape sequences.



-- 
https://bugs.ruby-lang.org/

Unsubscribe: <mailto:ruby-core-request / ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>