Actions
Bug #14247
closedThread#fetch raise KeyError without key and receiver
Bug #14247:
Thread#fetch raise KeyError without key and receiver
Description
Files
Actions
Added by znz (Kazuhiro NISHIYAMA) over 8 years ago. Updated over 8 years ago.
Description
Files
| Thread-KeyError.diff (870 Bytes) Thread-KeyError.diff | znz (Kazuhiro NISHIYAMA), 12/27/2017 12:05 PM | ||
| 0001-Fix-KeyError-key-receiver-of-Thread-fetch.patch (1.22 KB) 0001-Fix-KeyError-key-receiver-of-Thread-fetch.patch | znz (Kazuhiro NISHIYAMA), 12/27/2017 01:54 PM |
The given key is :fooo symbol, so the message should be :fooo but not "fooo".
Use "%+"PRIsVALUE instead of "\"%"PRIsVALUE"\"" for inspection.
Update patch.
% ruby -e 'th=Thread.current;th[:foo]=1;th.fetch(:fooo)'
Traceback (most recent call last):
1: from -e:1:in `<main>'
-e:1:in `fetch': key not found: :fooo (KeyError)
Did you mean? :foo
% ruby -e 'th=Thread.current;th[:foo]=1;th.fetch("fooo")'
Traceback (most recent call last):
1: from -e:1:in `<main>'
-e:1:in `fetch': key not found: "fooo" (KeyError)
Did you mean? :foo
Indeed. I actually had to look twice to see the error. :)
Applied in changeset trunk|r61507.
Fix KeyError#{key,receiver} of Thread#fetch
[ruby-core:84508] [Bug #14247]
ruby_2_5 r61583 merged revision(s) 61507.