From: Motohiro KOSAKI Date: 2011-10-08T20:41:33+09:00 Subject: [ruby-core:40055] [Backport93 - Backport #5311] PStore fails to save data when default encodings are set Issue #5311 has been updated by Motohiro KOSAKI. this seems no regression. ---------------------------------------- Backport #5311: PStore fails to save data when default encodings are set http://redmine.ruby-lang.org/issues/5311 Author: Cameron Pope Status: Assigned Priority: Normal Assignee: Yuki Sonoda Category: Target version: When PStore opens its data files, it does so using the File::BINARY flag, which ensures that Windows will not do cr-lf conversions, but it does not ensure that file#external_encoding is ASCII_8BIT (Binary). That means that under certain circumstances (when Encoding.internal_encoding is defined) that PStore will sometimes raise errors when writing to disk because Marshal.dump will emit a byte sequence that is not valid with the file's external encoding. To illustrate, I've submitted a patch that contains a test that fails in Ruby 1.9.x, but passes with the minor change to PStore: to specify external_encoding when opening its data files. -- http://redmine.ruby-lang.org