Created
December 2, 2019 14:53
-
-
Save jams2/11a60020a1ada897d79fc4c77fb587eb to your computer and use it in GitHub Desktop.
Fixing Django/GEOS compatibility
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
"""The version regex in django/contrib/gis/geos/libgeos.py fails on | |
the latest homebrew geos install at time of writing, with message: | |
django.contrib.gis.geos.error.GEOSException: Could not parse version info string "3.8.0-CAPI-1.13.1 " | |
The trailing whitespace is the culprit. Add a r'\s?$' to the end of the pattern. | |
""" | |
version_regex = re.compile( | |
r'^(?P<version>(?P<major>\d+)\.(?P<minor>\d+)\.(?P<subminor>\d+))' | |
r'((rc(?P<release_candidate>\d+))|dev)?-CAPI-(?P<capi_version>\d+\.\d+\.\d+)( r\d+)?( \w+)?\s?$' | |
) |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
I have the same error on Ubuntu 20.04 and Django 1.11.25 on python2.
I fixed it by changing file
/home/dima/.virtualenvs/irkru/lib/python2.7/site-packages/django/contrib/gis/geos/libgeos.py
on line196
from this:to this:
Why they don't include this simple fix in Django 1.11 update?
And why version info of the package has a trailing whitespace?
It used to work fine on Ubuntu 18, but crashes after update.