Bug#890646: python3-postgresql: Connect to postgresql-Database Version 10 (buster) fails with an python error
Package: python3-postgresql Version: 1.1.0-2+b4 Followup-For: Bug #890646 Dear Maintainer, This is not a problem with python3.5 but happens on 3.6. * What led up to the situation? In [2]: import postgresql In [3]: db = postgresql.open('pq://js:x.js@localhost:5432/js') Traceback (most recent call last): File "", line 1, in db = postgresql.open('pq://js:x.js@localhost:5432/js') File "/usr/lib/python3/dist-packages/postgresql/__init__.py", line 94, in open c.connect() File "/usr/lib/python3/dist-packages/postgresql/driver/pq3.py", line 2422, in connect self._establish() File "/usr/lib/python3/dist-packages/postgresql/driver/pq3.py", line 2554, in _establish self.version_info = pg_version.normalize(pg_version.split(sv)) File "/usr/lib/python3/dist-packages/postgresql/versionstring.py", line 28, in split vlist = [int(x or '0') for x in v[:-1]] File "/usr/lib/python3/dist-packages/postgresql/versionstring.py", line 28, in vlist = [int(x or '0') for x in v[:-1]] ValueError: invalid literal for int() with base 10: '4 (Debian 10' * What exactly did you do (or not do) that was effective (or ineffective)? * What was the outcome of this action? * What outcome did you expect instead? No -- System Information: Debian Release: buster/sid APT prefers proposed-updates APT policy: (500, 'proposed-updates'), (500, 'testing'), (2, 'unstable') Architecture: amd64 (x86_64) Foreign Architectures: i386 Kernel: Linux 4.16.0-1-amd64 (SMP w/4 CPU cores) Locale: LANG=en_ZA.utf8, LC_CTYPE=en_ZA.utf8 (charmap=UTF-8), LANGUAGE=en_ZA.utf8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) LSM: AppArmor: enabled Versions of packages python3-postgresql depends on: ii libc6 2.27-3 ii libjs-jquery 3.2.1-1 ii libjs-underscore 1.8.3~dfsg-1 ii libpython3-stdlib 3.6.5-3 ii python33.6.5-3 python3-postgresql recommends no packages. python3-postgresql suggests no packages. -- no debconf information The integrity and confidentiality of this e-mail is governed by these terms / Die integriteit en vertroulikheid van hierdie e-pos word deur die volgende bepalings gereël. http://www.sun.ac.za/emaildisclaimer
Bug#890646: python3-postgresql: Connect to postgresql-Database Version 10 (buster) fails with an python error
On Sat, 17 Feb 2018 07:56:31 + Marten KARLwrote: > Package: python3-postgresql > Version: 1.1.0-2+b4 > Severity: grave > Justification: renders package unusable > > Split of Versionstring fails: > db = postgresql.open(database='marten',host='10.8.2.1',port=5431) > # postgresql-v10 runs on port 5431 on that machine > -> > File "/usr/lib/python3/dist-packages/postgresql/versionstring.py", line 28, in > vlist = [int(x or '0') for x in v[:-1]] > ValueError: invalid literal for int() with base 10: '2 (Debian 10' > > My solution: > Changed line from > v = vstr.strip().split('.') > to > v = vstr.strip().split(' ')[0].split('.') > > Tests with that changed file run well with different databases on postgresql v9.4, v9.6 and 10.2 > on my systems. There is a new upstream release: https://pypi.python.org/pypi/py-postgresql I checked and this is unchanged. From the bit of text provided, it looks like the version number is customized in the Debian postgresql packages and python3-postgresql doesn't handle it well. The patch seems reasonable to me. Scott K
Bug#890646: python3-postgresql: Connect to postgresql-Database Version 10 (buster) fails with an python error
Package: python3-postgresql Version: 1.1.0-2+b4 Severity: grave Justification: renders package unusable Split of Versionstring fails: db = postgresql.open(database='marten',host='10.8.2.1',port=5431) # postgresql-v10 runs on port 5431 on that machine -> File "/usr/lib/python3/dist-packages/postgresql/versionstring.py", line 28, in vlist = [int(x or '0') for x in v[:-1]] ValueError: invalid literal for int() with base 10: '2 (Debian 10' My solution: Changed line from v = vstr.strip().split('.') to v = vstr.strip().split(' ')[0].split('.') Tests with that changed file run well with different databases on postgresql v9.4, v9.6 and 10.2 on my systems. -- System Information: Debian Release: 9.3 APT prefers stable APT policy: (990, 'stable'), (500, 'stable-updates'), (500, 'testing') Architecture: amd64 (x86_64) Kernel: Linux 4.9.0-5-amd64 (SMP w/4 CPU cores) Locale: LANG=en_US.UTF-8, LC_CTYPE=en_US.UTF-8 (charmap=UTF-8), LANGUAGE=en_US.UTF-8 (charmap=UTF-8) Shell: /bin/sh linked to /bin/dash Init: systemd (via /run/systemd/system) Versions of packages python3-postgresql depends on: ii libc6 2.24-11+deb9u1 ii libjs-jquery 3.2.1-1 ii libjs-underscore 1.8.3~dfsg-1 ii libpython3-stdlib 3.5.3-1 ii python33.5.3-1 python3-postgresql recommends no packages. python3-postgresql suggests no packages. -- no debconf information