[#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

[#102513] [Ruby master Bug#17631] `Numeric#real?` incorrectly returns true for `NaN` and `INFINITY` โ€” jtannas@...

Issue #17631 has been reported by jtannas (Joel Tannas).

8 messages 2021/02/16

[#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