psych icon indicating copy to clipboard operation
psych copied to clipboard

A libyaml wrapper for Ruby

Results 138 psych issues
Sort by recently updated
recently updated
newest added

Hey! 🙌 The origin of this issue is [`i18n-tasks`](https://github.com/glebm/i18n-tasks) which [delegates](https://github.com/glebm/i18n-tasks/issues/291#issuecomment-414433435) YAML dumping to this library. > I've spotted that `i18n-tasks normalize` converts emoji characters into unicode which makes them...

### Problem `$ irb -r psych` ```ruby irb(main):001:0> Psych.load(Psych.dump(/\d/)) == /\d/ => true irb(main):002:0> Psych.load(Psych.dump(/\//)) == /\// => false ``` ## STR ``` $ cat psych_regexp.rb ``` ```ruby # frozen_string_literal:...

The current `build_exception` relies on the `Exception` implementation containing a instance variable `mesg`: https://github.com/ruby/ruby/blob/c8661de0143c1d434dd9f68910ae304c59f8576b/ext/psych/psych_to_ruby.c#L9-L16 Should this use `rb_exc_new_str()` (which would also call `initialize`)? cc: @eregon

I have multiple files that just look fine with editors (gedit, sublime, vim) but produce the following error message when loaded by Psych: ``` Psych.safe_load(file) /usr/local/lib/ruby/3.0.0/psych.rb:456:in `parse': (): invalid trailing...

```ruby require 'time' require 'yaml' date = DateTime.parse('22018-01-05') serialized_date = YAML.dump(date) YAML.load(serialized_date) # => fails with NoMethodError: undefined method `captures' for nil:NilClass ``` This is because the [regex for parsing...

Reproduciton code: ```rb require "yaml" YAML.load %(foo:\n - "x\u000Cy") ``` The above YAML text has a control character U+000C, which is not allowed. The code gives the following error message:...

In https://bitbucket.org/asomov/snakeyaml/pull-requests/7 SnakeYAML added features to support parsing and emitting comments. Unfortunately this has had a side effect of deferring some emits, and there does not appear to be a...

`ScalarScanner.parse_int` uses `Integer()` to parse items that match the `INTEGER` regex. Strings with leading/trailing underscores will fail to parse, even though they match the regex. Example: ```irb(main):011:0> Integer("1234") => 1234...

The following line, when reached by the tests from #475, triggers SnakeYAML to raise an error: https://github.com/ruby/psych/blob/546154ddb71b125794c5eed36817ad27ac373dd5/lib/psych/visitors/yaml_tree.rb#L520 The error: ``` RuntimeError: org.yaml.snakeyaml.emitter.EmitterException: tag is not specified scalar at org/jruby/ext/psych/PsychEmitter.java:206 visit_Psych_Nodes_Scalar...

JRuby

YAML.safe_load will raise an exception when you try to load text that happens to contain a sequence of regexp that looks like a network device propmt but is not: 3.0.0...