- Notifications
You must be signed in to change notification settings - Fork35
Closed
Description
On Linux Mint (an Ubuntu derivative), the version string produced by postgres isn't parsed correctly byget_pg_version()
in utils.py:
$ /usr/lib/postgresql/15/bin/postgres --versionpostgres (PostgreSQL) 15.5 (Ubuntu 15.5-1.pgdg22.04+1)$ python ./tests/test_simple.py Traceback (most recent call last): File "testgres/env/lib/python3.10/site-packages/testgres/utils.py", line 31, in __init__ super().__init__(version) File "testgres/env/lib/python3.10/site-packages/packaging/version.py", line 200, in __init__ raise InvalidVersion(f"Invalid version: '{version}'")packaging.version.InvalidVersion: Invalid version: '15.5-1.pgdg22.04+1)'
There appears to be a fairly simple fix inget_pg_version()
, line 185:
# Remove "(Homebrew)" and "(Ubuntu <version>)" if present raw_ver = raw_ver.replace('(Homebrew)', '').strip() raw_ver = re.sub('\(Ubuntu[^)]*\)', '', raw_ver).strip()
Metadata
Metadata
Assignees
Labels
No labels