Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup - Mailing list pgadmin-hackers

From Jan Alexander Steffens
Subject Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup
Date
Msg-id CAMQ-g0eDvgKLQ8Qv2PUYOhkY2VurWarobOcyi1oa4+kOVUNPNw@mail.gmail.com
Whole thread Raw
In response to Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup  (Dave Page <dpage@pgadmin.org>)
Responses Re: [pgadmin-hackers] [pgAdmin4] [PATCH] Simplify Server's python setup  (Dave Page <dpage@pgadmin.org>)
List pgadmin-hackers
On Thu, Jan 26, 2017 at 3:58 PM Dave Page <dpage@pgadmin.org> wrote:
In the meantime, I'm thinking something like the attached patch would
be more appropriate. The only issue I can find with it at the moment
(having just tested on a Mac dev environment for now) is that if
initialisation fails and you enter a new Python Executable path, the
Py_Finalize()/Py_Initialize cycle isn't enough to make the change - it
seems to be because Py_SetProgramName() doesn't have any effect when
called again. In other words, you can give it the correct interpreter
and hit OK to attempt to run the server again, but it still won't work
until you actually restart the app.

Any ideas?

Looking through the cpython code, Py_SetPath(NULL) clears the calculated module search path again. Try calling this before the Py_Initialize.

pgadmin-hackers by date:

Previous
From: George Gelashvili
Date:
Subject: [pgadmin-hackers][Patch] Refactor sql template version picking
Next
From: George Gelashvili
Date:
Subject: Re: [pgadmin-hackers][Patch] Refactor sql template version picking