PyInquirer icon indicating copy to clipboard operation
PyInquirer copied to clipboard

'KeyError' when clicking on an item in list with mouse

Open thomastiotto opened this issue 6 years ago • 16 comments

On MacOS, when I click with the mouse on any item of a PyInquirer list I get a KeyError thrown; this happens both in Terminal and in iTerm2. I have looked through the source code and can't find a KeyError explicitly being thrown, so it must be inside some subroutine.

Following is an example error that happens when I click on the "Test" item: Source code: image Before clicking: image After clicking: image

thomastiotto avatar Mar 04 '19 18:03 thomastiotto

Same on Fedora with version 1.0.3.

Redauser avatar Mar 25 '19 13:03 Redauser

I'll look into this

CITGuru avatar Mar 25 '19 18:03 CITGuru

The solution is already in the pull-request! thank you!

Redauser avatar Mar 25 '19 18:03 Redauser

@Tioz90 Can you install from the repo directly to check if your error is fixed

CITGuru avatar Mar 26 '19 00:03 CITGuru

@CITGuru it doesn't crash anymore but I'm not sure if it's correctly populating the dictionary as clicking displays in PyInquirer but my program doesn't register it. I'll need to look into this. Ex: clicking on elements registers in PyInquirer but no action is taken by my program image

Clicking on a separator throws an error in my Switch so I guess something is being returned. I'[ll get back to you.

thomastiotto avatar Mar 26 '19 09:03 thomastiotto

okay, will be waiting

CITGuru avatar Mar 26 '19 09:03 CITGuru

Hi, I tested it and it's still not fixed

thomastiotto avatar Apr 01 '19 17:04 thomastiotto

Confirmed fixed on Ubuntu as of 918f8e14f

@Tioz90 which verision did you test on? Latest tag (1.0.3) doesn't have the fix yet, have you installed the latest version from git?

Kos avatar Jun 07 '19 11:06 Kos

@Tioz90 Can you test from that #37

CITGuru avatar Jun 07 '19 13:06 CITGuru

@Tioz90 Are you still having this issue? Sorry for the late reply

CITGuru avatar Jul 08 '20 07:07 CITGuru

I don’t know, I abandoned the software I was developing months ago.

thomastiotto avatar Jul 08 '20 07:07 thomastiotto

Oh, I get. This has been fixed already in the current master. I will be releasing the new version to PyPI

CITGuru avatar Jul 08 '20 08:07 CITGuru

So I am developing an app with your library. Thus I will test when the new version is released. My current fix is (what we should anyway do) to use .get("key", "default value").

Thus a fix will look like this: https://github.com/cobbler/libcobblersignatures/commit/0a20f4abb291be2104576d7bb578473e6ebc4c54

SchoolGuy avatar Jul 18 '20 18:07 SchoolGuy

@CITGuru I'm on version 1.0.3, which seems latest, and still getting the error on click. What am I missing?

ilmoi avatar Aug 25 '20 18:08 ilmoi

@CITGuru Same here, v1.0.3 and the error is present.

1mS3r avatar Sep 02 '20 21:09 1mS3r

Still affects 1.0.3.

HenryHoggard avatar Sep 10 '20 14:09 HenryHoggard