Re: Fix key error - Mailing list pgadmin-hackers

From Surinder Kumar
Subject Re: Fix key error
Date
Msg-id CAM5-9D9GhE4ZnG5xFZaAFoeZaDwC9YmNQLRmS0SL0tjJ1TJYBg@mail.gmail.com
Whole thread Raw
In response to Fix key error  (Dave Cramer <davecramer@gmail.com>)
List pgadmin-hackers

Hi,

On Tue, Aug 8, 2017 at 12:23 AM, Dave Cramer <davecramer@gmail.com> wrote:

I don't think this line in web/pgadmin/browser/server_groups/servers/types.py does what it should.

default_path = config.DEFAULT_BINARY_PATHS[st.stype] or ""

will ever succeed if the key does not exist

Attached patch should work.

​It can be written as:

default_path = config.DEFAULT_BINARY_PATHS.get(st.stype, "")

Reference link

​Thanks for the patch.​


Dave Cramer

pgadmin-hackers by date:

Previous
From: Dave Cramer
Date:
Subject: Can someone tell me what this code does ?
Next
From: Ashesh Vashi
Date:
Subject: Re: [pgAdmin4][Patch]: Allow user to cancel long running queries from dashboard