rails/rails — Issue #4657: Loading binary fixture data w/ YAML::ENGINE Psych fails
Author: SomeOfThemAreKillers
Created: 2012-01-25 06:24:41+00:00
State: open

Hi,

With the Syck YAML engine in Ruby 1.8.7 I am able to load the following in a Rails 3.2.0 fixture file (rake db:fixtures:load):

```yaml
person:
first_name: Sam
encrypted_pass_phrase: "\r<\xD1\x8B\xC3\xF7\xE3\xE8\xF4\xB3\b\"D\xDB\xA9\x80"
```

With the Psych YAML engine in Ruby 1.9.2p290, 1.9.3p0, or 1.9.3-head any possible approach to load this data fails with "Psych::SyntaxError: (): couldn't parse YAML at line 0 column 0".

Note this very recently resolved issue allows serialization of binary data with Psych: https://bugs.ruby-lang.org/issues/5923 . Loading the output of that fixed code via fixtures even fails however, and I've needed to fall back to Syck via:

```ruby
require 'yaml'
YAML::ENGINE.yamler = 'syck'
```

in my Rails 3.2 app's boot.rb file.

Thanks.