Actions
Bug #14247
closedThread#fetch raise KeyError without key and receiver
Description
I found this by message without Did you mean?
.
expected:
% 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
actual:
% 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)
Files
Updated by nobu (Nobuyoshi Nakada) about 7 years ago
The given key is :fooo
symbol, so the message should be :fooo
but not "fooo"
.
Use "%+"PRIsVALUE
instead of "\"%"PRIsVALUE"\""
for inspection.
Updated by znz (Kazuhiro NISHIYAMA) about 7 years ago
- File 0001-Fix-KeyError-key-receiver-of-Thread-fetch.patch 0001-Fix-KeyError-key-receiver-of-Thread-fetch.patch added
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
Updated by shevegen (Robert A. Heiler) about 7 years ago
Indeed. I actually had to look twice to see the error. :)
Updated by Anonymous about 7 years ago
- Status changed from Assigned to Closed
Applied in changeset trunk|r61507.
Fix KeyError#{key,receiver} of Thread#fetch
[ruby-core:84508] [Bug #14247]
Updated by nagachika (Tomoyuki Chikanaga) about 7 years ago
- Backport changed from 2.3: UNKNOWN, 2.4: UNKNOWN, 2.5: UNKNOWN to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED
Updated by naruse (Yui NARUSE) about 7 years ago
- Backport changed from 2.3: DONTNEED, 2.4: DONTNEED, 2.5: REQUIRED to 2.3: DONTNEED, 2.4: DONTNEED, 2.5: DONE
ruby_2_5 r61583 merged revision(s) 61507.
Actions
Like0
Like0Like0Like0Like0Like0Like0