[ruby-core:90952] [Ruby trunk Bug#8303][Closed] YAML does not persist Exception#backtrace

From: tenderlove@...
Date: 2019-01-09 21:54:19 UTC
List: ruby-core #90952
Issue #8303 has been updated by tenderlovemaking (Aaron Patterson).

Status changed from Assigned to Closed
Backport deleted (1.9.3: UNKNOWN, 2.0.0: UNKNOWN)

This is fixed here: https://github.com/ruby/psych/pull/382

----------------------------------------
Bug #8303: YAML does not persist Exception#backtrace
https://bugs.ruby-lang.org/issues/8303#change-76158

* Author: josh.cheek (Josh Cheek)
* Status: Closed
* Priority: Normal
* Assignee: tenderlovemaking (Aaron Patterson)
* Target version: 
* ruby -v: ruby 2.0.0p0 (2013-02-24 revision 39474) [x86_64-darwin12.2.0]
* Backport: 
----------------------------------------
require 'yaml'

begin
  raise "omg"
rescue

  # yaml loses the backtrace
  YAML.load(YAML.dump $!).backtrace # => nil
  
  # marshal persists the backtrace
  Marshal.load(Marshal.dump $!).backtrace # => ["-:4:in `<main>'"]

end



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

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

In This Thread

Prev Next