Issue2233

classification
Title: KeyError for dict.pop() incorrect / inconsistent with CPython
Type: behaviour Severity: normal
Components: Core Versions: Jython 2.7
Milestone:
process
Status: closed Resolution: fixed
Dependencies: Superseder:
Assigned To: Nosy List: Arfrever, santa4nt, zyasoft
Priority: Keywords: patch

Created on 2014-11-21.01:23:01 by Arfrever, last changed 2015-01-04.17:03:58 by zyasoft.

Files
File name Uploaded Description Edit Remove
issue2233.patch santa4nt, 2014-11-21.19:13:56
unnamed santa4nt, 2014-12-15.19:09:15
Messages
msg9215 (view) Author: Arfrever Frehtes Taifersar Arahesis (Arfrever) Date: 2014-11-21.01:23:01
CPython 2.7:

>>> {}.pop("a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'a'
>>> {"a":1}.pop("b")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'b'


Jython 2.7:
>>> {}.pop("a")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'popitem(): dictionary is empty'
>>> {"a":1}.pop("b")
Traceback (most recent call last):
  File "<stdin>", line 1, in <module>
KeyError: 'popitem(): dictionary is empty'
msg9220 (view) Author: Santoso Wijaya (santa4nt) Date: 2014-11-21.19:13:56
The right exception type was being thrown. It's just the message given to the exception instance that's wrong. Easily fixed. Attaching a patch for review.
msg9236 (view) Author: Jim Baker (zyasoft) Date: 2014-12-15.18:33:37
Santoso,

+1. Do you want to apply this trivial patch?
msg9240 (view) Author: Santoso Wijaya (santa4nt) Date: 2014-12-15.19:09:16
D'oh. I'm still in sending patches for commit mindset. Is there any
developers guide for committers somewhere?

On Mon, Dec 15, 2014, 10:33 AM Jim Baker <report@bugs.jython.org> wrote:

>
> Jim Baker added the comment:
>
> Santoso,
>
> +1. Do you want to apply this trivial patch?
>
> ----------
> nosy: +zyasoft
>
> _______________________________________
> Jython tracker <report@bugs.jython.org>
> <http://bugs.jython.org/issue2233>
> _______________________________________
>
msg9241 (view) Author: Santoso Wijaya (santa4nt) Date: 2014-12-15.20:06:41
Nevermind, I found it!

The fix is now committed with https://hg.python.org/jython/rev/f68d65a141f7
History
Date User Action Args
2015-01-04 17:03:58zyasoftsetstatus: pending -> closed
2014-12-17 02:52:31zyasoftsetstatus: open -> pending
resolution: fixed
2014-12-15 20:06:41santa4ntsetmessages: + msg9241
2014-12-15 19:09:16santa4ntsetfiles: + unnamed
messages: + msg9240
2014-12-15 18:33:37zyasoftsetnosy: + zyasoft
messages: + msg9236
2014-11-21 19:13:56santa4ntsetfiles: + issue2233.patch
keywords: + patch
messages: + msg9220
2014-11-21 18:57:45santa4ntsetnosy: + santa4nt
type: behaviour
components: + Core
2014-11-21 01:23:01Arfrevercreate