summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authortenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-07 21:31:43 +0000
committertenderlove <tenderlove@b2dd03c8-39d4-4d8f-98ff-823fe69b080e>2012-04-07 21:31:43 +0000
commita9649469b5de1ae185bde4c5dbece6f16e89c85d (patch)
treefb5b830b4f66880b610fd0bcf547f49df4cc5b9b
parent79086bb454f604cc993f57b270333d409eb8d900 (diff)
merge revision(s) 35245,35248:
* ext/psych/lib/psych.rb: bumping up psych version to match release. * ext/psych/psych.gemspec: ditto * ext/psych/parser.c: fall back to any encoding if the external encoding is wrong. [ruby-core:44163] * test/psych/test_encoding.rb: fix test git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/branches/ruby_1_9_3@35251 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
-rw-r--r--ChangeLog11
-rw-r--r--ext/psych/lib/psych.rb2
-rw-r--r--ext/psych/parser.c7
-rw-r--r--test/psych/test_encoding.rb2
-rw-r--r--version.h2
5 files changed, 18 insertions, 6 deletions
diff --git a/ChangeLog b/ChangeLog
index eaa1e5e548..9d5c1115e4 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,14 @@
+Sat Apr 7 10:28:40 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/lib/psych.rb: bumping up psych version to match release.
+ * ext/psych/psych.gemspec: ditto
+
+Sat Apr 7 02:07:00 2012 Aaron Patterson <aaron@tenderlovemaking.com>
+
+ * ext/psych/parser.c: fall back to any encoding if the external
+ encoding is wrong. [ruby-core:44163]
+ * test/psych/test_encoding.rb: fix test
+
Wed Apr 4 18:29:15 2012 NAKAMURA Usaku <usa@ruby-lang.org>
* test/ruby/test_sleep.rb (TestSleep#test_sleep_5sec): syntax error.
diff --git a/ext/psych/lib/psych.rb b/ext/psych/lib/psych.rb
index 82578204fb..1895be6193 100644
--- a/ext/psych/lib/psych.rb
+++ b/ext/psych/lib/psych.rb
@@ -93,7 +93,7 @@ require 'psych/handlers/document_stream'
module Psych
# The version is Psych you're using
- VERSION = '1.3.1'
+ VERSION = '1.3.2'
# The version of libyaml Psych is using
LIBYAML_VERSION = Psych.libyaml_version.join '.'
diff --git a/ext/psych/parser.c b/ext/psych/parser.c
index 9808c6b60e..6f4c4569e9 100644
--- a/ext/psych/parser.c
+++ b/ext/psych/parser.c
@@ -146,10 +146,11 @@ static VALUE transcode_io(VALUE src, int * parser_encoding)
return src;
}
- rb_raise(rb_eArgError, "YAML file must be UTF-8, UTF-16LE, or UTF-16BE, not %s",
- rb_enc_name(rb_enc_from_index(io_external_enc_index)));
+ /* If the external encoding is something we don't know how to handle,
+ * fall back to YAML_ANY_ENCODING. */
+ *parser_encoding = YAML_ANY_ENCODING;
- return Qnil;
+ return src;
}
#endif
diff --git a/test/psych/test_encoding.rb b/test/psych/test_encoding.rb
index 8efb676d9a..1abee0df16 100644
--- a/test/psych/test_encoding.rb
+++ b/test/psych/test_encoding.rb
@@ -57,7 +57,7 @@ module Psych
# If the external encoding isn't utf8, utf16le, or utf16be, we cannot
# process the file.
File.open(t.path, 'r', :encoding => 'SHIFT_JIS') do |f|
- assert_raises ArgumentError do
+ assert_raises Psych::SyntaxError do
Psych.load(f)
end
end
diff --git a/version.h b/version.h
index 2c79e24091..b3cead555d 100644
--- a/version.h
+++ b/version.h
@@ -1,5 +1,5 @@
#define RUBY_VERSION "1.9.3"
-#define RUBY_PATCHLEVEL 176
+#define RUBY_PATCHLEVEL 177
#define RUBY_RELEASE_DATE "2012-04-04"
#define RUBY_RELEASE_YEAR 2012