Qt runtime issue on python 3 + patch

From: Asser Schrøder Femø <asser(dot)femoe(at)gmail(dot)com>
To: pgadmin-hackers(at)postgresql(dot)org
Subject: Qt runtime issue on python 3 + patch
Date: 2016-06-11 13:17:11
Message-ID: CACbbB7hdN=04qpMt1MKiz2ZEM4UXzniphQN76X=5A2i3bemHLw@mail.gmail.com
Views: Raw Message | Whole Thread | Download mbox | Resend email
Thread:
Lists: pgadmin-hackers

Hello pgadmin hackers,

I checked out the newly released beta and wanted to see how easy it would
be to package for Arch Linux, but ran into this error with the Qt runtime:

Python path:
"/home/asser/.virtualenvs/pgadmin4-python34/lib/python3.4/site-packages;/home/asser/src/pgadmin4-beta1/web"
Webapp path: "/home/asser/projects/pgadmin4/web/pgAdmin4.py"
Traceback (most recent call last):
File "/home/asser/projects/pgadmin4/web/pgAdmin4.py", line 23, in <module>
import config
File "/home/asser/projects/pgadmin4/web/config.py", line 255, in <module>
from config_local import *
File "<frozen importlib._bootstrap>", line 2237, in _find_and_load
File "<frozen importlib._bootstrap>", line 2222, in
_find_and_load_unlocked
File "<frozen importlib._bootstrap>", line 2164, in _find_spec
File "<frozen importlib._bootstrap>", line 1940, in find_spec
File "<frozen importlib._bootstrap>", line 1914, in _get_spec
File "<frozen importlib._bootstrap>", line 2049, in find_spec
File "<frozen importlib._bootstrap>", line 53, in _path_join
File "<frozen importlib._bootstrap>", line 53, in <listcomp>
TypeError: 'str' does not support the buffer interface
"Failed to launch the application server, server thread exiting."

According to Stackoverflow, exchanging PyBytes_FromString with
PyUnicode_DecodeFSDefault when building the pythonpath makes it work again
(see attached diff). I don't know why though, perhaps somebody will be able
to enlighten me :-)

Same issue and fix on Python 3.4 and 3.5 on Arch Linux. I don't know if the
patch has any complications on other platforms.

Thanks for building the successor to pgAdmin3! It already looks good and
I'm looking forward to further refinement. Hopefully I'll be able to
contribute a bit along the way.

cheers,
Asser

Attachment Content-Type Size
runtime_pythonpath_fix.diff text/plain 507 bytes

Responses

Browse pgadmin-hackers by date

  From Date Subject
Next Message Dave Page 2016-06-11 17:15:05 pgAdmin 4 commit: This quite trivial patch adds support for HiDPI (i.e.
Previous Message Leonard Hecker 2016-06-11 12:01:17 PATCH: Support for HiDPI Displays on OS X (pgAdmin4)