[#102393] [Ruby master Feature#17608] Compact and sum in one step — sawadatsuyoshi@...

Issue #17608 has been reported by sawa (Tsuyoshi Sawada).

13 messages 2021/02/04

[#102438] [Ruby master Bug#17619] if false foo=42; end creates a foo local variable set to nil — pkmuldoon@...

Issue #17619 has been reported by pkmuldoon (Phil Muldoon).

10 messages 2021/02/10

[#102631] [Ruby master Feature#17660] Expose information about which basic methods have been redefined — tenderlove@...

Issue #17660 has been reported by tenderlovemaking (Aaron Patterson).

9 messages 2021/02/27

[#102639] [Ruby master Misc#17662] The herdoc pattern used in tests does not syntax highlight correctly in many editors — eregontp@...

Issue #17662 has been reported by Eregon (Benoit Daloze).

13 messages 2021/02/27

[#102652] [Ruby master Bug#17664] Behavior of sockets changed in Ruby 3.0 to non-blocking — ciconia@...

Issue #17664 has been reported by ciconia (Sharon Rosner).

23 messages 2021/02/28

[ruby-core:102587] [Ruby master Bug#17556] ruby 2.7.2 ::YAML.dump ArgumentError: invalid value for Integer(): "20210101_"

From: kicktheken@...
Date: 2021-02-23 23:51:41 UTC
List: ruby-core #102587
Issue #17556 has been updated by kicktheken (Kenneth Chan).


Hello, when will this fix be available in the ruby 2.7 release branch?

----------------------------------------
Bug #17556: ruby 2.7.2 ::YAML.dump ArgumentError: invalid value for Integer(): "20210101_"
https://bugs.ruby-lang.org/issues/17556#change-90574

* Author: zhang.shuttlerock (Yuki Snow)
* Status: Closed
* Priority: Normal
* ruby -v: 2.7.2
* Backport: 2.5: UNKNOWN, 2.6: UNKNOWN, 2.7: UNKNOWN, 3.0: UNKNOWN
----------------------------------------
再現方法
ruby '2.7.2'
'rails', '~> 6.0.3'

- 利用している ruby のバージョン(ruby -v)
   2.7.2
- 再現スクリプト

  ```ruby
   $ bundle exec rails c
   [1] pry(main)> ::YAML.dump '20210101_'
   ArgumentError: invalid value for Integer(): "20210101_"
   from /Users/xxxx/.rbenv/versions/2.7.2/lib/ruby/2.7.0/psych/scalar_scanner.rb:104:in `Integer'
  ```
- 再現方法から得られた結果
   '20210101_'や'2021__0101'は文字列ですので、elsif string.match?(INTEGER)分岐に入るのは良いかどうか不明ですが、
   整数として処理する場合、「,」だけは足りないでしょう。
   ```ruby
    def parse_int string
      Integer(string.gsub(/[,]/, ''))
    end
    ```

- 期待する結果とその理由
   エラーにならないように。



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

Unsubscribe: <mailto:ruby-core-request@ruby-lang.org?subject=unsubscribe>
<http://lists.ruby-lang.org/cgi-bin/mailman/options/ruby-core>

In This Thread

Prev Next